Skip to content

Commit

Permalink
fix: Remove explicit import of FromIterator (ParkMyCar#369)
Browse files Browse the repository at this point in the history
* start

* fmt and clippy
  • Loading branch information
ParkMyCar authored Feb 21, 2024
1 parent 118963f commit 20c1520
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
10 changes: 2 additions & 8 deletions compact_str/src/features/proptest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
use alloc::string::String;

use proptest::arbitrary::{
Arbitrary,
StrategyFor,
};
use proptest::arbitrary::StrategyFor;
use proptest::prelude::*;
use proptest::strategy::{
MapInto,
Strategy,
};
use proptest::strategy::MapInto;
use proptest::string::StringParam;

use crate::CompactString;
Expand Down
5 changes: 1 addition & 4 deletions compact_str/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ use core::hash::{
Hash,
Hasher,
};
use core::iter::{
FromIterator,
FusedIterator,
};
use core::iter::FusedIterator;
use core::ops::{
Add,
AddAssign,
Expand Down
1 change: 0 additions & 1 deletion compact_str/src/repr/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use alloc::borrow::Cow;
use alloc::boxed::Box;
use alloc::string::String;
use core::iter::FromIterator;

use super::{
InlineBuffer,
Expand Down
5 changes: 2 additions & 3 deletions compact_str/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use core::{

use proptest::collection::SizeRange;
use proptest::prelude::*;
use proptest::strategy::Strategy;
use test_case::test_case;
use test_strategy::proptest;

Expand Down Expand Up @@ -592,7 +591,7 @@ fn test_plus_operator() {
// String + &String
assert_eq!(String::from("a") + &("b".to_string()), "ab");
// String + &str
assert_eq!(String::from("a") + &"b", "ab");
assert_eq!(String::from("a") + "b", "ab");
}

#[allow(clippy::unnecessary_to_owned, clippy::op_ref)]
Expand Down Expand Up @@ -623,7 +622,7 @@ fn test_plus_operator_static_str() {
// String + &String
assert_eq!(String::from("a") + &("b".to_string()), "ab");
// String + &str
assert_eq!(String::from("a") + &"b", "ab");
assert_eq!(String::from("a") + "b", "ab");
}

#[test]
Expand Down

0 comments on commit 20c1520

Please sign in to comment.