Skip to content

Commit 6f2de7b

Browse files
committed
Regenerate code files
Ran `scripts/generate_code.py`
1 parent f98ecf4 commit 6f2de7b

File tree

91 files changed

+171
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+171
-171
lines changed

samples/rust_generated/my_game/sample/color_generated.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a> flatbuffers::Follow<'a> for Color {
6060
type Inner = Self;
6161
#[inline]
6262
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
63-
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
63+
let b = unsafe { flatbuffers::read_scalar_at::<i8>(buf, loc) };
6464
Self(b)
6565
}
6666
}
@@ -69,7 +69,7 @@ impl flatbuffers::Push for Color {
6969
type Output = Color;
7070
#[inline]
7171
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
72-
flatbuffers::emplace_scalar::<i8>(dst, self.0);
72+
unsafe { flatbuffers::emplace_scalar::<i8>(dst, self.0); }
7373
}
7474
}
7575

samples/rust_generated/my_game/sample/equipment_generated.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'a> flatbuffers::Follow<'a> for Equipment {
5656
type Inner = Self;
5757
#[inline]
5858
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
59-
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
59+
let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
6060
Self(b)
6161
}
6262
}
@@ -65,7 +65,7 @@ impl flatbuffers::Push for Equipment {
6565
type Output = Equipment;
6666
#[inline]
6767
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
68-
flatbuffers::emplace_scalar::<u8>(dst, self.0);
68+
unsafe { flatbuffers::emplace_scalar::<u8>(dst, self.0); }
6969
}
7070
}
7171

samples/rust_generated/my_game/sample/monster_generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<'a> flatbuffers::Follow<'a> for Monster<'a> {
2020
type Inner = Monster<'a>;
2121
#[inline]
2222
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
23-
Self { _tab: flatbuffers::Table::new(buf, loc) }
23+
Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
2424
}
2525
}
2626

@@ -451,14 +451,14 @@ pub fn size_prefixed_root_as_monster_with_opts<'b, 'o>(
451451
/// # Safety
452452
/// Callers must trust the given bytes do indeed contain a valid `Monster`.
453453
pub unsafe fn root_as_monster_unchecked(buf: &[u8]) -> Monster {
454-
flatbuffers::root_unchecked::<Monster>(buf)
454+
unsafe { flatbuffers::root_unchecked::<Monster>(buf) }
455455
}
456456
#[inline]
457457
/// Assumes, without verification, that a buffer of bytes contains a size prefixed Monster and returns it.
458458
/// # Safety
459459
/// Callers must trust the given bytes do indeed contain a valid size prefixed `Monster`.
460460
pub unsafe fn size_prefixed_root_as_monster_unchecked(buf: &[u8]) -> Monster {
461-
flatbuffers::size_prefixed_root_unchecked::<Monster>(buf)
461+
unsafe { flatbuffers::size_prefixed_root_unchecked::<Monster>(buf) }
462462
}
463463
#[inline]
464464
pub fn finish_monster_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(

samples/rust_generated/my_game/sample/vec_3_generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ impl<'a> flatbuffers::Follow<'a> for Vec3 {
3333
type Inner = &'a Vec3;
3434
#[inline]
3535
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
36-
<&'a Vec3>::follow(buf, loc)
36+
unsafe { <&'a Vec3>::follow(buf, loc) }
3737
}
3838
}
3939
impl<'a> flatbuffers::Follow<'a> for &'a Vec3 {
4040
type Inner = &'a Vec3;
4141
#[inline]
4242
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
43-
flatbuffers::follow_cast_ref::<Vec3>(buf, loc)
43+
unsafe { flatbuffers::follow_cast_ref::<Vec3>(buf, loc) }
4444
}
4545
}
4646
impl<'b> flatbuffers::Push for Vec3 {
4747
type Output = Vec3;
4848
#[inline]
4949
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
50-
let src = ::core::slice::from_raw_parts(self as *const Vec3 as *const u8, <Self as flatbuffers::Push>::size());
50+
let src = unsafe { ::core::slice::from_raw_parts(self as *const Vec3 as *const u8, <Self as flatbuffers::Push>::size()) };
5151
dst.copy_from_slice(src);
5252
}
5353
#[inline]

samples/rust_generated/my_game/sample/weapon_generated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<'a> flatbuffers::Follow<'a> for Weapon<'a> {
2020
type Inner = Weapon<'a>;
2121
#[inline]
2222
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
23-
Self { _tab: flatbuffers::Table::new(buf, loc) }
23+
Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
2424
}
2525
}
2626

tests/arrays_test/my_game/example/array_struct_generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ impl<'a> flatbuffers::Follow<'a> for ArrayStruct {
3636
type Inner = &'a ArrayStruct;
3737
#[inline]
3838
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
39-
<&'a ArrayStruct>::follow(buf, loc)
39+
unsafe { <&'a ArrayStruct>::follow(buf, loc) }
4040
}
4141
}
4242
impl<'a> flatbuffers::Follow<'a> for &'a ArrayStruct {
4343
type Inner = &'a ArrayStruct;
4444
#[inline]
4545
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
46-
flatbuffers::follow_cast_ref::<ArrayStruct>(buf, loc)
46+
unsafe { flatbuffers::follow_cast_ref::<ArrayStruct>(buf, loc) }
4747
}
4848
}
4949
impl<'b> flatbuffers::Push for ArrayStruct {
5050
type Output = ArrayStruct;
5151
#[inline]
5252
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
53-
let src = ::core::slice::from_raw_parts(self as *const ArrayStruct as *const u8, <Self as flatbuffers::Push>::size());
53+
let src = unsafe { ::core::slice::from_raw_parts(self as *const ArrayStruct as *const u8, <Self as flatbuffers::Push>::size()) };
5454
dst.copy_from_slice(src);
5555
}
5656
#[inline]

tests/arrays_test/my_game/example/array_table_generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<'a> flatbuffers::Follow<'a> for ArrayTable<'a> {
2020
type Inner = ArrayTable<'a>;
2121
#[inline]
2222
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
23-
Self { _tab: flatbuffers::Table::new(buf, loc) }
23+
Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
2424
}
2525
}
2626

@@ -193,14 +193,14 @@ pub fn size_prefixed_root_as_array_table_with_opts<'b, 'o>(
193193
/// # Safety
194194
/// Callers must trust the given bytes do indeed contain a valid `ArrayTable`.
195195
pub unsafe fn root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable {
196-
flatbuffers::root_unchecked::<ArrayTable>(buf)
196+
unsafe { flatbuffers::root_unchecked::<ArrayTable>(buf) }
197197
}
198198
#[inline]
199199
/// Assumes, without verification, that a buffer of bytes contains a size prefixed ArrayTable and returns it.
200200
/// # Safety
201201
/// Callers must trust the given bytes do indeed contain a valid size prefixed `ArrayTable`.
202202
pub unsafe fn size_prefixed_root_as_array_table_unchecked(buf: &[u8]) -> ArrayTable {
203-
flatbuffers::size_prefixed_root_unchecked::<ArrayTable>(buf)
203+
unsafe { flatbuffers::size_prefixed_root_unchecked::<ArrayTable>(buf) }
204204
}
205205
pub const ARRAY_TABLE_IDENTIFIER: &str = "ARRT";
206206

tests/arrays_test/my_game/example/nested_struct_generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ impl<'a> flatbuffers::Follow<'a> for NestedStruct {
3434
type Inner = &'a NestedStruct;
3535
#[inline]
3636
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
37-
<&'a NestedStruct>::follow(buf, loc)
37+
unsafe { <&'a NestedStruct>::follow(buf, loc) }
3838
}
3939
}
4040
impl<'a> flatbuffers::Follow<'a> for &'a NestedStruct {
4141
type Inner = &'a NestedStruct;
4242
#[inline]
4343
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
44-
flatbuffers::follow_cast_ref::<NestedStruct>(buf, loc)
44+
unsafe { flatbuffers::follow_cast_ref::<NestedStruct>(buf, loc) }
4545
}
4646
}
4747
impl<'b> flatbuffers::Push for NestedStruct {
4848
type Output = NestedStruct;
4949
#[inline]
5050
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
51-
let src = ::core::slice::from_raw_parts(self as *const NestedStruct as *const u8, <Self as flatbuffers::Push>::size());
51+
let src = unsafe { ::core::slice::from_raw_parts(self as *const NestedStruct as *const u8, <Self as flatbuffers::Push>::size()) };
5252
dst.copy_from_slice(src);
5353
}
5454
#[inline]

tests/arrays_test/my_game/example/test_enum_generated.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a> flatbuffers::Follow<'a> for TestEnum {
6060
type Inner = Self;
6161
#[inline]
6262
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
63-
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
63+
let b = unsafe { flatbuffers::read_scalar_at::<i8>(buf, loc) };
6464
Self(b)
6565
}
6666
}
@@ -69,7 +69,7 @@ impl flatbuffers::Push for TestEnum {
6969
type Output = TestEnum;
7070
#[inline]
7171
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
72-
flatbuffers::emplace_scalar::<i8>(dst, self.0);
72+
unsafe { flatbuffers::emplace_scalar::<i8>(dst, self.0); }
7373
}
7474
}
7575

tests/include_test1/my_game/other_name_space/from_include_generated.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a> flatbuffers::Follow<'a> for FromInclude {
5252
type Inner = Self;
5353
#[inline]
5454
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
55-
let b = flatbuffers::read_scalar_at::<i64>(buf, loc);
55+
let b = unsafe { flatbuffers::read_scalar_at::<i64>(buf, loc) };
5656
Self(b)
5757
}
5858
}
@@ -61,7 +61,7 @@ impl flatbuffers::Push for FromInclude {
6161
type Output = FromInclude;
6262
#[inline]
6363
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
64-
flatbuffers::emplace_scalar::<i64>(dst, self.0);
64+
unsafe { flatbuffers::emplace_scalar::<i64>(dst, self.0); }
6565
}
6666
}
6767

0 commit comments

Comments
 (0)