Skip to content

Commit dad014e

Browse files
committed
lib: clean up no_std and use of std in test code
Like we just did in Rustls and webpki, _always_ opt-in to no_std, and then import the std prelude in tests where necessary. This resolves some nightly clippy warnings about redundant imports that will arise otherwise
1 parent e2d220a commit dad014e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
unused_extern_crates,
5050
unused_qualifications
5151
)]
52-
#![cfg_attr(not(test), no_std)]
52+
#![no_std]
5353

5454
extern crate alloc;
55-
#[cfg(all(feature = "std", not(test)))]
55+
#[cfg(any(feature = "std", test))]
5656
extern crate std;
5757

5858
#[cfg(test)]

src/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#[cfg(test)]
22
mod unit {
3+
use alloc::{format, vec};
4+
use std::prelude::v1::*;
5+
36
use crate::{Error, Item};
47

58
#[test]

0 commit comments

Comments
 (0)