From 45dca98e5c029c10d6f839749795d0a9bedd0f9e Mon Sep 17 00:00:00 2001 From: Georges Palauqui Date: Mon, 28 Oct 2024 11:50:39 +0100 Subject: [PATCH] buffer_sv2: is a `no_std`crate by default - only feature `debug` will add `std` dep which is not used by any other crates - just had to replace `std::hint` by its `core` equivalent - in `debug` removed a `mut` to clear a warning --- utils/buffer/src/buffer_pool/mod.rs | 4 ++-- utils/buffer/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/buffer/src/buffer_pool/mod.rs b/utils/buffer/src/buffer_pool/mod.rs index eae9c41ab..705facfd8 100644 --- a/utils/buffer/src/buffer_pool/mod.rs +++ b/utils/buffer/src/buffer_pool/mod.rs @@ -606,7 +606,7 @@ impl Buffer for BufferPool { "{} {} {}", self.inner_memory.raw_offset, self.inner_memory.raw_len, self.inner_memory.len ); - let mut res = self.inner_memory.get_data_owned(shared_state, mode); + let res = self.inner_memory.get_data_owned(shared_state, mode); self.pool_back .set_len_from_inner_memory(self.inner_memory.len); println!( @@ -684,7 +684,7 @@ impl Buffer for BufferPool { impl Drop for BufferPool { fn drop(&mut self) { while self.shared_state.load(Ordering::Relaxed) != 0 { - std::hint::spin_loop(); + core::hint::spin_loop(); } } } diff --git a/utils/buffer/src/lib.rs b/utils/buffer/src/lib.rs index be1d3f8c3..11d1eb0d1 100644 --- a/utils/buffer/src/lib.rs +++ b/utils/buffer/src/lib.rs @@ -1,4 +1,4 @@ -//#![cfg_attr(not(feature = "debug"), no_std)] +#![cfg_attr(not(feature = "debug"), no_std)] //#![feature(backtrace)] mod buffer;