Skip to content

Commit

Permalink
Fix new unused_mut detected by nightly-2023-04-30
Browse files Browse the repository at this point in the history
    warning: variable does not need to be mutable
      --> src/expand.rs:51:17
       |
    51 |             let mut prev = &mut self.vec[i];
       |                 ----^^^^
       |                 |
       |                 help: remove this `mut`
       |
       = note: `#[warn(unused_mut)]` on by default

    warning: variable does not need to be mutable
       --> src/run.rs:649:21
        |
    649 |                 let mut entry = map
        |                     ----^^^^^
        |                     |
        |                     help: remove this `mut`
  • Loading branch information
dtolnay committed Apr 30, 2023
1 parent 07a3bfa commit 7d89384
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl ExpandedTestSet {

fn insert(&mut self, test: Test, error: Option<Error>, is_from_glob: bool) {
if let Some(&i) = self.path_to_index.get(&test.path) {
let mut prev = &mut self.vec[i];
let prev = &mut self.vec[i];
if prev.is_from_glob {
prev.test.expected = test.expected;
return;
Expand Down
2 changes: 1 addition & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ fn parse_cargo_json(
Some(test) => test,
None => continue,
};
let mut entry = map
let entry = map
.entry(de.target.src_path)
.or_insert_with(Stderr::default);
if de.message.level == "error" {
Expand Down

0 comments on commit 7d89384

Please sign in to comment.