mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 13:20:00 +00:00
fix lints in rust tests (#6743)
Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -1341,8 +1341,9 @@ impl<'a> Vec3 {
|
||||
unsafe { &*(self.0[26..].as_ptr() as *const Test) }
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
pub fn set_test3(&mut self, x: &Test) {
|
||||
self.0[26..26+4].copy_from_slice(&x.0)
|
||||
self.0[26..26 + 4].copy_from_slice(&x.0)
|
||||
}
|
||||
|
||||
pub fn unpack(&self) -> Vec3T {
|
||||
@@ -1626,24 +1627,27 @@ impl<'a> StructOfStructs {
|
||||
unsafe { &*(self.0[0..].as_ptr() as *const Ability) }
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
pub fn set_a(&mut self, x: &Ability) {
|
||||
self.0[0..0+8].copy_from_slice(&x.0)
|
||||
self.0[0..0 + 8].copy_from_slice(&x.0)
|
||||
}
|
||||
|
||||
pub fn b(&self) -> &Test {
|
||||
unsafe { &*(self.0[8..].as_ptr() as *const Test) }
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
pub fn set_b(&mut self, x: &Test) {
|
||||
self.0[8..8+4].copy_from_slice(&x.0)
|
||||
self.0[8..8 + 4].copy_from_slice(&x.0)
|
||||
}
|
||||
|
||||
pub fn c(&self) -> &Ability {
|
||||
unsafe { &*(self.0[12..].as_ptr() as *const Ability) }
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
pub fn set_c(&mut self, x: &Ability) {
|
||||
self.0[12..12+8].copy_from_slice(&x.0)
|
||||
self.0[12..12 + 8].copy_from_slice(&x.0)
|
||||
}
|
||||
|
||||
pub fn unpack(&self) -> StructOfStructsT {
|
||||
|
||||
Reference in New Issue
Block a user