diff options
author | Kamil Rojewski <kamil.rojewski@gmail.com> | 2021-04-15 17:19:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-15 11:19:13 -0400 |
commit | c012f29f915a97e493a7ed4d9898b61ba945694d (patch) | |
tree | 085cf5007a9b1b188379df5ce2e7d36bd646cdb7 | |
parent | df2df21ec1be2468106fed10c1533eacc1cf0d2e (diff) | |
download | flatbuffers-c012f29f915a97e493a7ed4d9898b61ba945694d.tar.gz flatbuffers-c012f29f915a97e493a7ed4d9898b61ba945694d.tar.bz2 flatbuffers-c012f29f915a97e493a7ed4d9898b61ba945694d.zip |
silenced clippy warning (#6565)
-rw-r--r-- | samples/monster_generated.rs | 2 | ||||
-rw-r--r-- | src/idl_gen_rust.cpp | 1 | ||||
-rw-r--r-- | tests/include_test/sub/include_test2_generated.rs | 1 | ||||
-rw-r--r-- | tests/monster_test_generated.rs | 5 | ||||
-rw-r--r-- | tests/more_defaults_generated.rs | 1 | ||||
-rw-r--r-- | tests/namespace_test/namespace_test1_generated.rs | 2 | ||||
-rw-r--r-- | tests/namespace_test/namespace_test2_generated.rs | 2 | ||||
-rw-r--r-- | tests/optional_scalars_generated.rs | 1 |
8 files changed, 15 insertions, 0 deletions
diff --git a/samples/monster_generated.rs b/samples/monster_generated.rs index fa9babdb..017fbdf2 100644 --- a/samples/monster_generated.rs +++ b/samples/monster_generated.rs @@ -96,6 +96,7 @@ impl flatbuffers::EndianScalar for Color { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i8::from_le(self.0); Self(b) @@ -180,6 +181,7 @@ impl flatbuffers::EndianScalar for Equipment { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) diff --git a/src/idl_gen_rust.cpp b/src/idl_gen_rust.cpp index 248e68c5..a1d01935 100644 --- a/src/idl_gen_rust.cpp +++ b/src/idl_gen_rust.cpp @@ -743,6 +743,7 @@ class RustGenerator : public BaseGenerator { code_ += " {{FROM_BASE}}"; code_ += " }"; code_ += " #[inline]"; + code_ += " #[allow(clippy::wrong_self_convention)]"; code_ += " fn from_little_endian(self) -> Self {"; code_ += " let b = {{BASE_TYPE}}::from_le({{INTO_BASE}});"; code_ += " {{FROM_BASE}}"; diff --git a/tests/include_test/sub/include_test2_generated.rs b/tests/include_test/sub/include_test2_generated.rs index 709d488d..1a1debe1 100644 --- a/tests/include_test/sub/include_test2_generated.rs +++ b/tests/include_test/sub/include_test2_generated.rs @@ -91,6 +91,7 @@ impl flatbuffers::EndianScalar for FromInclude { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i64::from_le(self.0); Self(b) diff --git a/tests/monster_test_generated.rs b/tests/monster_test_generated.rs index 1f981fe1..cff8433c 100644 --- a/tests/monster_test_generated.rs +++ b/tests/monster_test_generated.rs @@ -292,6 +292,7 @@ impl flatbuffers::EndianScalar for Color { unsafe { Self::from_bits_unchecked(b) } } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.bits()); unsafe { Self::from_bits_unchecked(b) } @@ -384,6 +385,7 @@ impl flatbuffers::EndianScalar for Race { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i8::from_le(self.0); Self(b) @@ -476,6 +478,7 @@ impl flatbuffers::EndianScalar for Any { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) @@ -664,6 +667,7 @@ impl flatbuffers::EndianScalar for AnyUniqueAliases { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) @@ -852,6 +856,7 @@ impl flatbuffers::EndianScalar for AnyAmbiguousAliases { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) diff --git a/tests/more_defaults_generated.rs b/tests/more_defaults_generated.rs index afb74bd4..26db2b1c 100644 --- a/tests/more_defaults_generated.rs +++ b/tests/more_defaults_generated.rs @@ -79,6 +79,7 @@ impl flatbuffers::EndianScalar for ABC { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i32::from_le(self.0); Self(b) diff --git a/tests/namespace_test/namespace_test1_generated.rs b/tests/namespace_test/namespace_test1_generated.rs index 7a886310..fc877543 100644 --- a/tests/namespace_test/namespace_test1_generated.rs +++ b/tests/namespace_test/namespace_test1_generated.rs @@ -92,6 +92,7 @@ impl flatbuffers::EndianScalar for UnionInNestedNS { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) @@ -228,6 +229,7 @@ impl flatbuffers::EndianScalar for EnumInNestedNS { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i8::from_le(self.0); Self(b) diff --git a/tests/namespace_test/namespace_test2_generated.rs b/tests/namespace_test/namespace_test2_generated.rs index f21eeeef..9878e2f4 100644 --- a/tests/namespace_test/namespace_test2_generated.rs +++ b/tests/namespace_test/namespace_test2_generated.rs @@ -92,6 +92,7 @@ impl flatbuffers::EndianScalar for UnionInNestedNS { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = u8::from_le(self.0); Self(b) @@ -228,6 +229,7 @@ impl flatbuffers::EndianScalar for EnumInNestedNS { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i8::from_le(self.0); Self(b) diff --git a/tests/optional_scalars_generated.rs b/tests/optional_scalars_generated.rs index f27ecf4c..9ef7ad37 100644 --- a/tests/optional_scalars_generated.rs +++ b/tests/optional_scalars_generated.rs @@ -88,6 +88,7 @@ impl flatbuffers::EndianScalar for OptionalByte { Self(b) } #[inline] + #[allow(clippy::wrong_self_convention)] fn from_little_endian(self) -> Self { let b = i8::from_le(self.0); Self(b) |