mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 18:14:13 +00:00
Refactor idl_gen_rust and Rust generated code to use consistent whitespace (#6809)
* Remove dead code in idl_gen_rust * Use 2space indentation in mod.rs * use In/DecrementIdentValue in idl_gen_rust Fix some whitespace too in generated code. * make default fn 2space ident * More 2space formatting * git clang format * make vs2015 happy Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -12,34 +12,36 @@ pub struct InParentNamespace<'a> {
|
||||
}
|
||||
|
||||
impl<'a> flatbuffers::Follow<'a> for InParentNamespace<'a> {
|
||||
type Inner = InParentNamespace<'a>;
|
||||
#[inline]
|
||||
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
Self { _tab: flatbuffers::Table { buf, loc } }
|
||||
}
|
||||
type Inner = InParentNamespace<'a>;
|
||||
#[inline]
|
||||
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
Self { _tab: flatbuffers::Table { buf, loc } }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> InParentNamespace<'a> {
|
||||
pub const fn get_fully_qualified_name() -> &'static str {
|
||||
"MyGame.InParentNamespace"
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
|
||||
InParentNamespace { _tab: table }
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
|
||||
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
|
||||
_args: &'args InParentNamespaceArgs) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>> {
|
||||
let mut builder = InParentNamespaceBuilder::new(_fbb);
|
||||
builder.finish()
|
||||
}
|
||||
pub const fn get_fully_qualified_name() -> &'static str {
|
||||
"MyGame.InParentNamespace"
|
||||
}
|
||||
|
||||
pub fn unpack(&self) -> InParentNamespaceT {
|
||||
InParentNamespaceT {
|
||||
}
|
||||
#[inline]
|
||||
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
|
||||
InParentNamespace { _tab: table }
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
|
||||
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
|
||||
_args: &'args InParentNamespaceArgs
|
||||
) -> flatbuffers::WIPOffset<InParentNamespace<'bldr>> {
|
||||
let mut builder = InParentNamespaceBuilder::new(_fbb);
|
||||
builder.finish()
|
||||
}
|
||||
|
||||
pub fn unpack(&self) -> InParentNamespaceT {
|
||||
InParentNamespaceT {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::Verifiable for InParentNamespace<'_> {
|
||||
@@ -56,11 +58,11 @@ impl flatbuffers::Verifiable for InParentNamespace<'_> {
|
||||
pub struct InParentNamespaceArgs {
|
||||
}
|
||||
impl<'a> Default for InParentNamespaceArgs {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
InParentNamespaceArgs {
|
||||
}
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
InParentNamespaceArgs {
|
||||
}
|
||||
}
|
||||
}
|
||||
pub struct InParentNamespaceBuilder<'a: 'b, 'b> {
|
||||
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
|
||||
Reference in New Issue
Block a user