Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/flatbuffers/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ where
T: 'a + Follow<'a>,
<T as Follow<'a>>::Inner: serde::ser::Serialize,
{
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
fn serialize<S>(&self, serializer: S) -> core::result::Result<S::Ok, S::Error>
where
S: serde::ser::Serializer,
{
Expand Down
3 changes: 3 additions & 0 deletions rust/flatbuffers/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,12 +1228,14 @@ impl<T> IndexMut<ReverseIndexRange> for [T] {
mod tests {
use super::*;
use core::sync::atomic::{AtomicUsize, Ordering};
#[cfg(feature = "std")]
use std::alloc::{GlobalAlloc, Layout, System};

static ALLOC_COUNT: AtomicUsize = AtomicUsize::new(0);

struct CountingAllocator;

#[cfg(feature = "std")]
unsafe impl GlobalAlloc for CountingAllocator {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
ALLOC_COUNT.fetch_add(1, Ordering::Relaxed);
Expand All @@ -1244,6 +1246,7 @@ mod tests {
}
}

#[cfg(feature = "std")]
#[global_allocator]
static GLOBAL: CountingAllocator = CountingAllocator;

Expand Down
2 changes: 1 addition & 1 deletion rust/flatbuffers/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ where
T: 'a + Follow<'a>,
<T as Follow<'a>>::Inner: serde::ser::Serialize,
{
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
fn serialize<S>(&self, serializer: S) -> core::result::Result<S::Ok, S::Error>
where
S: serde::ser::Serializer,
{
Expand Down