Skip to content

Commit 18fe0e1

Browse files
committed
fix: avoid implicit import of std::prelude
Conditional `cfg_attr` on `no_std` has an unforeseen consequence: implicit import of `std::prelude` in the default configuration. That makes it harder to notice if we accidentally use any `std` types available from the prelude.
1 parent a575249 commit 18fe0e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@
3232
//! # now you can use dynamic modules with the NGINX
3333
//! ```
3434
35-
// support both std and no_std
36-
#![cfg_attr(not(feature = "std"), no_std)]
3735
#![warn(missing_docs)]
36+
// support both std and no_std
37+
#![no_std]
3838
#[cfg(all(not(feature = "std"), feature = "alloc"))]
3939
extern crate alloc;
40+
#[cfg(feature = "std")]
41+
extern crate std;
4042

4143
/// The core module.
4244
///

0 commit comments

Comments
 (0)