diff options
| author | bors <bors@rust-lang.org> | 2020-10-30 14:24:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-30 14:24:02 +0000 |
| commit | ffe52882ed79be67344dd6085559e308241e7f60 (patch) | |
| tree | dea8fd60ec5b2aa448b12e491cf8d23053a7892a /compiler/rustc_data_structures/src | |
| parent | 388ef349043f20a1a8a3011eaf49dee220485e0a (diff) | |
| parent | 5339bd1ebeb76ea7304ff07dcf8e6c317ba0ced8 (diff) | |
| download | rust-ffe52882ed79be67344dd6085559e308241e7f60.tar.gz rust-ffe52882ed79be67344dd6085559e308241e7f60.zip | |
Auto merge of #78424 - jyn514:THE-PAPERCLIP-COMETH, r=davidtwco
Fix some more clippy warnings Found while working on https://github.com/rust-lang/rust/pull/77351. It turns out that `x.py clippy --fix` does work on that branch as long as you pass `CARGOFLAGS=--lib`.
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/scc/mod.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/sso/map.rs | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_data_structures/src/graph/scc/mod.rs b/compiler/rustc_data_structures/src/graph/scc/mod.rs index 2db8e466e11..486a9ba77b7 100644 --- a/compiler/rustc_data_structures/src/graph/scc/mod.rs +++ b/compiler/rustc_data_structures/src/graph/scc/mod.rs @@ -307,10 +307,7 @@ where fn walk_unvisited_node(&mut self, depth: usize, node: G::Node) -> WalkReturn<S> { debug!("walk_unvisited_node(depth = {:?}, node = {:?})", depth, node); - debug_assert!(match self.node_states[node] { - NodeState::NotVisited => true, - _ => false, - }); + debug_assert!(matches!(self.node_states[node], NodeState::NotVisited)); // Push `node` onto the stack. self.node_states[node] = NodeState::BeingVisited { depth }; diff --git a/compiler/rustc_data_structures/src/sso/map.rs b/compiler/rustc_data_structures/src/sso/map.rs index fa510e58314..fe8ae7abf98 100644 --- a/compiler/rustc_data_structures/src/sso/map.rs +++ b/compiler/rustc_data_structures/src/sso/map.rs @@ -395,7 +395,7 @@ where V: Copy, { fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: T) { - self.extend(iter.into_iter().map(|(k, v)| (k.clone(), v.clone()))) + self.extend(iter.into_iter().map(|(k, v)| (*k, *v))) } #[inline] @@ -451,7 +451,7 @@ impl<'a, K, V> IntoIterator for &'a SsoHashMap<K, V> { fn into_iter(self) -> Self::IntoIter { match self { SsoHashMap::Array(array) => EitherIter::Left(array.into_iter().map(adapt_array_ref_it)), - SsoHashMap::Map(map) => EitherIter::Right(map.into_iter()), + SsoHashMap::Map(map) => EitherIter::Right(map.iter()), } } } @@ -469,7 +469,7 @@ impl<'a, K, V> IntoIterator for &'a mut SsoHashMap<K, V> { fn into_iter(self) -> Self::IntoIter { match self { SsoHashMap::Array(array) => EitherIter::Left(array.into_iter().map(adapt_array_mut_it)), - SsoHashMap::Map(map) => EitherIter::Right(map.into_iter()), + SsoHashMap::Map(map) => EitherIter::Right(map.iter_mut()), } } } |
