mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 23:40:57 +00:00
Fixes unused imports in Rust code generator (#8828)
* Fixes unused imports in Rust code generator * Regenerates generated schemas
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// @generated
|
||||
extern crate alloc;
|
||||
extern crate flatbuffers;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::string::{String, ToString};
|
||||
use alloc::vec::Vec;
|
||||
use core::mem;
|
||||
use core::cmp::Ordering;
|
||||
use self::flatbuffers::{EndianScalar, Follow};
|
||||
use super::*;
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
pub const ENUM_MIN_ABC: i32 = 0;
|
||||
@@ -47,8 +40,8 @@ impl ABC {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl core::fmt::Debug for ABC {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
impl ::core::fmt::Debug for ABC {
|
||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||
if let Some(name) = self.variant_name() {
|
||||
f.write_str(name)
|
||||
} else {
|
||||
@@ -56,24 +49,24 @@ impl core::fmt::Debug for ABC {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<'a> flatbuffers::Follow<'a> for ABC {
|
||||
impl<'a> ::flatbuffers::Follow<'a> for ABC {
|
||||
type Inner = Self;
|
||||
#[inline]
|
||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
let b = unsafe { flatbuffers::read_scalar_at::<i32>(buf, loc) };
|
||||
let b = unsafe { ::flatbuffers::read_scalar_at::<i32>(buf, loc) };
|
||||
Self(b)
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::Push for ABC {
|
||||
impl ::flatbuffers::Push for ABC {
|
||||
type Output = ABC;
|
||||
#[inline]
|
||||
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
||||
unsafe { flatbuffers::emplace_scalar::<i32>(dst, self.0); }
|
||||
unsafe { ::flatbuffers::emplace_scalar::<i32>(dst, self.0) };
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::EndianScalar for ABC {
|
||||
impl ::flatbuffers::EndianScalar for ABC {
|
||||
type Scalar = i32;
|
||||
#[inline]
|
||||
fn to_little_endian(self) -> i32 {
|
||||
@@ -87,14 +80,13 @@ impl flatbuffers::EndianScalar for ABC {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> flatbuffers::Verifiable for ABC {
|
||||
impl<'a> ::flatbuffers::Verifiable for ABC {
|
||||
#[inline]
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
v: &mut ::flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
||||
i32::run_verifier(v, pos)
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::SimpleToVerifyInSlice for ABC {}
|
||||
impl ::flatbuffers::SimpleToVerifyInSlice for ABC {}
|
||||
|
||||
Reference in New Issue
Block a user