Generate better formatted Rust code (#8919)

* Cleans up Rust formatting

* Regenerates generated schemas
This commit is contained in:
Cameron Mulhern
2026-03-04 21:49:46 -05:00
committed by GitHub
parent 9c383559e0
commit 08b6372a36
95 changed files with 2783 additions and 1062 deletions

View File

@@ -2,15 +2,18 @@
// @generated
extern crate alloc;
use super::*;
// struct Ability, aligned to 4
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq)]
pub struct Ability(pub [u8; 8]);
impl Default for Ability {
fn default() -> Self {
Self([0; 8])
}
}
impl ::core::fmt::Debug for Ability {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
f.debug_struct("Ability")
@@ -21,27 +24,34 @@ impl ::core::fmt::Debug for Ability {
}
impl ::flatbuffers::SimpleToVerifyInSlice for Ability {}
impl<'a> ::flatbuffers::Follow<'a> for Ability {
type Inner = &'a Ability;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { <&'a Ability>::follow(buf, loc) }
}
}
impl<'a> ::flatbuffers::Follow<'a> for &'a Ability {
type Inner = &'a Ability;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { ::flatbuffers::follow_cast_ref::<Ability>(buf, loc) }
}
}
impl<'b> ::flatbuffers::Push for Ability {
type Output = Ability;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
let src = unsafe { ::core::slice::from_raw_parts(self as *const Ability as *const u8, <Self as ::flatbuffers::Push>::size()) };
dst.copy_from_slice(src);
}
#[inline]
fn alignment() -> ::flatbuffers::PushAlignment {
::flatbuffers::PushAlignment::new(4)
@@ -102,6 +112,7 @@ impl<'a> Ability {
}
}
#[inline]
pub fn key_compare_less_than(&self, o: &Ability) -> bool {
self.id() < o.id()
@@ -154,6 +165,7 @@ pub struct AbilityT {
pub id: u32,
pub distance: u32,
}
impl AbilityT {
pub fn pack(&self) -> Ability {
Ability::new(
@@ -162,4 +174,3 @@ impl AbilityT {
)
}
}