-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unconditionally import from alloc/core
Instead of doing this: ``` #[cfg(not(feature = "std"))] use alloc::borrow::Cow; #[cfg(feature = "std")] use std::borrow::Cow; ``` Just unconditionally import from alloc: ``` use alloc::borrow::Cow; ``` Enable #[warn(clippy::std_instead_of_alloc, clippy::std_instead_of_core)] to warn about these imports in the future. Conditionally declare #[no_std] if and only if not(cfg(feature = "std")) This is cleaner and avoids an `extern crate std` declaration, but semantically there should be no difference.
- Loading branch information
Showing
2 changed files
with
10 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters