Skip to content

Commit d9d64d4

Browse files
committed
Fix clippy issues
1 parent 8be230c commit d9d64d4

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

ci/tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535

3636
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
3737
if retry rustup component add clippy ; then
38-
cargo clippy --all --target=i586-unknown-linux-gnu -- -D clippy::pedantic
38+
cargo clippy --all --target=i586-unknown-linux-gnu -- -D clippy::all -D clippy::pedantic
3939
fi
4040
fi
4141

src/map.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,12 @@ pub enum DefaultHashBuilder {}
181181
/// ```
182182
/// use hashbrown::HashMap;
183183
///
184-
/// fn main() {
185-
/// let timber_resources: HashMap<&str, i32> =
186-
/// [("Norway", 100),
187-
/// ("Denmark", 50),
188-
/// ("Iceland", 10)]
189-
/// .iter().cloned().collect();
190-
/// // use the values stored in map
191-
/// }
184+
/// let timber_resources: HashMap<&str, i32> =
185+
/// [("Norway", 100),
186+
/// ("Denmark", 50),
187+
/// ("Iceland", 10)]
188+
/// .iter().cloned().collect();
189+
/// // use the values stored in map
192190
/// ```
193191
#[derive(Clone)]
194192
pub struct HashMap<K, V, S = DefaultHashBuilder> {
@@ -903,12 +901,10 @@ where
903901
/// ```
904902
/// use hashbrown::HashMap;
905903
///
906-
/// # fn main() {
907904
/// let mut map = HashMap::new();
908905
/// map.insert(1, "a");
909906
/// assert_eq!(map.remove_entry(&1), Some((1, "a")));
910907
/// assert_eq!(map.remove(&1), None);
911-
/// # }
912908
/// ```
913909
#[cfg_attr(feature = "inline-more", inline)]
914910
pub fn remove_entry<Q: ?Sized>(&mut self, k: &Q) -> Option<(K, V)>
@@ -2283,14 +2279,12 @@ impl<'a, K, V: Default, S> Entry<'a, K, V, S> {
22832279
/// # Examples
22842280
///
22852281
/// ```
2286-
/// # fn main() {
22872282
/// use hashbrown::HashMap;
22882283
///
22892284
/// let mut map: HashMap<&str, Option<u32>> = HashMap::new();
22902285
/// map.entry("poneyland").or_default();
22912286
///
22922287
/// assert_eq!(map["poneyland"], None);
2293-
/// # }
22942288
/// ```
22952289
#[cfg_attr(feature = "inline-more", inline)]
22962290
pub fn or_default(self) -> &'a mut V

src/raw/generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Group {
132132

133133
/// Returns a `BitMask` indicating all bytes in the group which are full.
134134
#[inline]
135-
pub fn match_full(&self) -> BitMask {
135+
pub fn match_full(self) -> BitMask {
136136
self.match_empty_or_deleted().invert()
137137
}
138138

src/raw/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,18 @@ impl Fallibility {
7474
/// Error to return on capacity overflow.
7575
#[cfg_attr(feature = "inline-more", inline)]
7676
fn capacity_overflow(self) -> CollectionAllocErr {
77-
use Fallibility::*;
7877
match self {
79-
Fallible => CollectionAllocErr::CapacityOverflow,
80-
Infallible => panic!("Hash table capacity overflow"),
78+
Fallibility::Fallible => CollectionAllocErr::CapacityOverflow,
79+
Fallibility::Infallible => panic!("Hash table capacity overflow"),
8180
}
8281
}
8382

8483
/// Error to return on allocation error.
8584
#[cfg_attr(feature = "inline-more", inline)]
8685
fn alloc_err(self, layout: Layout) -> CollectionAllocErr {
87-
use Fallibility::*;
8886
match self {
89-
Fallible => CollectionAllocErr::AllocErr { layout },
90-
Infallible => handle_alloc_error(layout),
87+
Fallibility::Fallible => CollectionAllocErr::AllocErr { layout },
88+
Fallibility::Infallible => handle_alloc_error(layout),
9189
}
9290
}
9391
}

0 commit comments

Comments
 (0)