From 9e56a36766ea7d669c73a1db9b4f584960b6f174 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 4 Mar 2024 04:41:16 +0900 Subject: [PATCH] Always set #![no_std] to fix redundant import warning ``` error: the item `Vec` is imported redundantly --> src/lib.rs:123:24 | 123 | use alloc::vec::{self, Vec}; | ^^^ | ::: /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:115:13 | 115 | pub use super::v1::*; | --------- the item `Vec` is already defined here | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` ``` --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7fc6f1a..8abec35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![warn( missing_debug_implementations, missing_docs, @@ -113,6 +113,8 @@ #[cfg(not(feature = "std"))] extern crate alloc; #[cfg(feature = "std")] +extern crate std; +#[cfg(feature = "std")] extern crate std as alloc; #[cfg(feature = "serde")]