Skip to content

Commit

Permalink
fix: avoid implicit import of std::prelude
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bavshin-f5 committed Jan 8, 2025
1 parent a575249 commit 18fe0e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
//! # now you can use dynamic modules with the NGINX
//! ```
// support both std and no_std
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
// support both std and no_std
#![no_std]
#[cfg(all(not(feature = "std"), feature = "alloc"))]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

/// The core module.
///
Expand Down

0 comments on commit 18fe0e1

Please sign in to comment.