From 093ea3143a052639c34a3f3d4e1d3a43c99a22c4 Mon Sep 17 00:00:00 2001 From: Adam Sasine Date: Sat, 1 Jun 2024 10:03:07 -0400 Subject: [PATCH] Replaced cfg_attr no_std with blanket no_std and extern crate in tests module --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 37decaf..39e82db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,7 @@ //! contains detailed information about the sensor's features, electrical characteristics, and registers. This package //! implements the functionality described in the datasheet and references the relevant sections in the documentation. -#![cfg_attr(not(test), no_std)] +#![no_std] use defmt::{debug, trace, Format}; use embedded_hal_async::{delay::DelayNs, i2c::I2c}; @@ -692,6 +692,9 @@ where #[cfg(test)] mod tests { + extern crate std; + use std::prelude::rust_2021::*; + use std::vec; use embedded_hal_mock::eh1::delay::{CheckedDelay, NoopDelay, Transaction as DelayTransaction}; use embedded_hal_mock::eh1::i2c::{Mock, Transaction as I2cTransaction}; use uom::ConstZero;