Updates Rust codegen to use proper indentation (#8952)

* Fixes identation of generated Rust code

* Regenerates generated schemas
This commit is contained in:
Cameron Mulhern
2026-03-05 09:04:55 -05:00
committed by GitHub
parent 2b8e4d3af0
commit 57659d9f38
105 changed files with 16456 additions and 16412 deletions

View File

@@ -8,38 +8,38 @@ use super::*;
#[derive(Clone, Copy, PartialEq)]
pub(crate) struct Object(pub [u8; 4]);
impl Default for Object {
fn default() -> Self {
Self([0; 4])
}
impl Default for Object {
fn default() -> Self {
Self([0; 4])
}
}
impl ::core::fmt::Debug for Object {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
f.debug_struct("Object")
.field("value", &self.value())
.finish()
}
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
f.debug_struct("Object")
.field("value", &self.value())
.finish()
}
}
impl ::flatbuffers::SimpleToVerifyInSlice for Object {}
impl<'a> ::flatbuffers::Follow<'a> for Object {
type Inner = &'a Object;
type Inner = &'a Object;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { <&'a Object>::follow(buf, loc) }
}
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { <&'a Object>::follow(buf, loc) }
}
}
impl<'a> ::flatbuffers::Follow<'a> for &'a Object {
type Inner = &'a Object;
type Inner = &'a Object;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { ::flatbuffers::follow_cast_ref::<Object>(buf, loc) }
}
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
unsafe { ::flatbuffers::follow_cast_ref::<Object>(buf, loc) }
}
}
impl<'b> ::flatbuffers::Push for Object {
@@ -58,73 +58,73 @@ impl<'b> ::flatbuffers::Push for Object {
}
impl<'a> ::flatbuffers::Verifiable for Object {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.in_buffer::<Self>(pos)
}
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.in_buffer::<Self>(pos)
}
}
impl<'a> Object {
#[allow(clippy::too_many_arguments)]
pub fn new(
value: i32,
) -> Self {
let mut s = Self([0; 4]);
s.set_value(value);
s
}
pub const fn get_fully_qualified_name() -> &'static str {
"Object"
}
pub fn value(&self) -> i32 {
let mut mem = ::core::mem::MaybeUninit::<<i32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
// Safety:
// Created from a valid Table for this object
// Which contains a valid value in this slot
::flatbuffers::EndianScalar::from_little_endian(unsafe {
::core::ptr::copy_nonoverlapping(
self.0[0..].as_ptr(),
mem.as_mut_ptr() as *mut u8,
::core::mem::size_of::<<i32 as ::flatbuffers::EndianScalar>::Scalar>(),
);
mem.assume_init()
})
}
pub fn set_value(&mut self, x: i32) {
let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
// Safety:
// Created from a valid Table for this object
// Which contains a valid value in this slot
unsafe {
::core::ptr::copy_nonoverlapping(
&x_le as *const _ as *const u8,
self.0[0..].as_mut_ptr(),
::core::mem::size_of::<<i32 as ::flatbuffers::EndianScalar>::Scalar>(),
);
#[allow(clippy::too_many_arguments)]
pub fn new(
value: i32,
) -> Self {
let mut s = Self([0; 4]);
s.set_value(value);
s
}
}
pub fn unpack(&self) -> ObjectT {
ObjectT {
value: self.value(),
pub const fn get_fully_qualified_name() -> &'static str {
"Object"
}
pub fn value(&self) -> i32 {
let mut mem = ::core::mem::MaybeUninit::<<i32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
// Safety:
// Created from a valid Table for this object
// Which contains a valid value in this slot
::flatbuffers::EndianScalar::from_little_endian(unsafe {
::core::ptr::copy_nonoverlapping(
self.0[0..].as_ptr(),
mem.as_mut_ptr() as *mut u8,
::core::mem::size_of::<<i32 as ::flatbuffers::EndianScalar>::Scalar>(),
);
mem.assume_init()
})
}
pub fn set_value(&mut self, x: i32) {
let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
// Safety:
// Created from a valid Table for this object
// Which contains a valid value in this slot
unsafe {
::core::ptr::copy_nonoverlapping(
&x_le as *const _ as *const u8,
self.0[0..].as_mut_ptr(),
::core::mem::size_of::<<i32 as ::flatbuffers::EndianScalar>::Scalar>(),
);
}
}
pub fn unpack(&self) -> ObjectT {
ObjectT {
value: self.value(),
}
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub(crate) struct ObjectT {
pub value: i32,
pub value: i32,
}
impl ObjectT {
pub fn pack(&self) -> Object {
Object::new(
self.value,
)
}
pub fn pack(&self) -> Object {
Object::new(
self.value,
)
}
}