diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2024-01-28 20:53:28 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2024-02-13 21:03:34 +0000 |
| commit | b3b9f31a869326bcd623c84fd230777f397847f3 (patch) | |
| tree | ec7980f1176fee6e2a0df03299df47ddc6be0196 /clippy_lints/src/index_refutable_slice.rs | |
| parent | 41227f964a5c75abeeb0a5d43c920275dffd9921 (diff) | |
| download | rust-b3b9f31a869326bcd623c84fd230777f397847f3.tar.gz rust-b3b9f31a869326bcd623c84fd230777f397847f3.zip | |
Bump `indexmap`
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
Diffstat (limited to 'clippy_lints/src/index_refutable_slice.rs')
| -rw-r--r-- | clippy_lints/src/index_refutable_slice.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clippy_lints/src/index_refutable_slice.rs b/clippy_lints/src/index_refutable_slice.rs index 51b4f26b6d1..41e9d5b1c2e 100644 --- a/clippy_lints/src/index_refutable_slice.rs +++ b/clippy_lints/src/index_refutable_slice.rs @@ -106,7 +106,8 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir } if sub_pat.is_some() { removed_pat.insert(value_hir_id); - slices.remove(&value_hir_id); + // FIXME(rust/#120456) - is `swap_remove` correct? + slices.swap_remove(&value_hir_id); return; } @@ -259,7 +260,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> { } // The slice was used for something other than indexing - self.slice_lint_info.remove(&local_id); + // FIXME(rust/#120456) - is `swap_remove` correct? + self.slice_lint_info.swap_remove(&local_id); } intravisit::walk_expr(self, expr); } |
