mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 14:46:26 +00:00
fixed warnings (#6355)
* semver-compatible deprecations * removed unneeded lifetimes (+ clippy warnings) * silenced too many args warning
This commit is contained in:
@@ -26,11 +26,11 @@ pub mod sample {
|
||||
extern crate flatbuffers;
|
||||
use self::flatbuffers::EndianScalar;
|
||||
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
pub const ENUM_MIN_COLOR: i8 = 0;
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
pub const ENUM_MAX_COLOR: i8 = 2;
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub const ENUM_VALUES_COLOR: [Color; 3] = [
|
||||
Color::Red,
|
||||
@@ -105,8 +105,8 @@ impl flatbuffers::EndianScalar for Color {
|
||||
|
||||
impl<'a> flatbuffers::Verifiable for Color {
|
||||
#[inline]
|
||||
fn run_verifier<'o, 'b>(
|
||||
v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
i8::run_verifier(v, pos)
|
||||
@@ -114,11 +114,11 @@ impl<'a> flatbuffers::Verifiable for Color {
|
||||
}
|
||||
|
||||
impl flatbuffers::SimpleToVerifyInSlice for Color {}
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
pub const ENUM_MIN_EQUIPMENT: u8 = 0;
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
pub const ENUM_MAX_EQUIPMENT: u8 = 1;
|
||||
#[deprecated(since = "1.13", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub const ENUM_VALUES_EQUIPMENT: [Equipment; 2] = [
|
||||
Equipment::NONE,
|
||||
@@ -190,8 +190,8 @@ impl flatbuffers::EndianScalar for Equipment {
|
||||
|
||||
impl<'a> flatbuffers::Verifiable for Equipment {
|
||||
#[inline]
|
||||
fn run_verifier<'o, 'b>(
|
||||
v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
u8::run_verifier(v, pos)
|
||||
@@ -257,14 +257,15 @@ impl<'b> flatbuffers::Push for &'b Vec3 {
|
||||
|
||||
impl<'a> flatbuffers::Verifiable for Vec3 {
|
||||
#[inline]
|
||||
fn run_verifier<'o, 'b>(
|
||||
v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
v.in_buffer::<Self>(pos)
|
||||
}
|
||||
}
|
||||
impl Vec3 {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(_x: f32, _y: f32, _z: f32) -> Self {
|
||||
Vec3 {
|
||||
x_: _x.to_little_endian(),
|
||||
@@ -389,8 +390,8 @@ impl<'a> Monster<'a> {
|
||||
|
||||
impl flatbuffers::Verifiable for Monster<'_> {
|
||||
#[inline]
|
||||
fn run_verifier<'o, 'b>(
|
||||
v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
v.visit_table(pos)?
|
||||
@@ -576,8 +577,8 @@ impl<'a> Weapon<'a> {
|
||||
|
||||
impl flatbuffers::Verifiable for Weapon<'_> {
|
||||
#[inline]
|
||||
fn run_verifier<'o, 'b>(
|
||||
v: &mut flatbuffers::Verifier<'o, 'b>, pos: usize
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
v.visit_table(pos)?
|
||||
@@ -637,13 +638,13 @@ impl std::fmt::Debug for Weapon<'_> {
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
#[deprecated(since="1.13", note="Deprecated in favor of `root_as...` methods.")]
|
||||
#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
|
||||
pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
|
||||
unsafe { flatbuffers::root_unchecked::<Monster<'a>>(buf) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[deprecated(since="1.13", note="Deprecated in favor of `root_as...` methods.")]
|
||||
#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
|
||||
pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> {
|
||||
unsafe { flatbuffers::size_prefixed_root_unchecked::<Monster<'a>>(buf) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user