Skip to content

Commit

Permalink
rustdoc: Use Vec::into_iter() rather than drain()
Browse files Browse the repository at this point in the history
This allows removing a `mut` which is nicer.

Suggested-by: @jyn514
Signed-off-by: Ian Jackson <[email protected]>
  • Loading branch information
ijackson committed Oct 28, 2020
1 parent 1d6c860 commit 776e204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl Options {
}
};

let mut default_settings: Vec<Vec<(String, String)>> = vec![
let default_settings: Vec<Vec<(String, String)>> = vec![
matches
.opt_str("default-theme")
.iter()
Expand All @@ -401,7 +401,7 @@ impl Options {
})
.collect(),
];
let default_settings = default_settings.drain(..).flatten().collect();
let default_settings = default_settings.into_iter().flatten().collect();

let test_args = matches.opt_strs("test-args");
let test_args: Vec<String> =
Expand Down

0 comments on commit 776e204

Please sign in to comment.