Skip to content

Commit

Permalink
Remove unused imports for no_std tests (#385)
Browse files Browse the repository at this point in the history
When running no_std tests I realised there were warnings. This removes
all of them and configures CI to complain when this happens next.
  • Loading branch information
JelteF committed Jul 12, 2024
1 parent 647e3a5 commit af823ea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/test_all_features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fi
set -euxo pipefail

for feature in $(tomljson Cargo.toml | jq --raw-output '.features | keys[]' | grep -v 'default\|std\|full\|testing-helpers'); do
cargo +nightly test -p derive_more --tests --no-default-features --features "$feature$std,testing-helpers"
RUSTFLAGS='-D warnings' cargo +nightly test -p derive_more --tests --no-default-features --features "$feature$std,testing-helpers"
done
2 changes: 1 addition & 1 deletion tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ mod generic {
// See: https://github.com/JelteF/derive_more/issues/301
mod complex_enum_syntax {
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format};
use alloc::format;

use derive_more::Debug;

Expand Down
2 changes: 1 addition & 1 deletion tests/deref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern crate alloc;

#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format, vec, vec::Vec};
use alloc::{boxed::Box, vec, vec::Vec};

use derive_more::DerefMut;

Expand Down
7 changes: 1 addition & 6 deletions tests/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
extern crate alloc;

#[cfg(not(feature = "std"))]
use alloc::{
boxed::Box,
format,
string::{String, ToString},
vec::Vec,
};
use alloc::{format, string::ToString};

use derive_more::{
Binary, Display, LowerExp, LowerHex, Octal, Pointer, UpperExp, UpperHex,
Expand Down

0 comments on commit af823ea

Please sign in to comment.