From 30568c5ee06bd789075cde033b3460e626eb3303 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 10 Mar 2024 17:26:35 +0100 Subject: [PATCH] Unconditionally use no_std And use `extern crate std;` when libstd is necessary. --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 50c63e892b..ecc1cc9980 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,10 @@ -#![cfg_attr(not(any(test, feature = "std")), no_std)] +#![no_std] //! A super simple initfs, only meant to be loaded into RAM by the bootloader, and then directly be //! read. +#[cfg(any(test, feature = "std"))] +extern crate std; + use core::convert::{TryFrom, TryInto}; pub mod types;