Skip to content

Commit

Permalink
Remove extraneous into_iter() (clippy 1.68 fix)
Browse files Browse the repository at this point in the history
https://doc.rust-lang.org/std/fs/fn.read_dir.html already returns an Iterator (`ReadDir`s IntoIter implementation returns `self`)
  • Loading branch information
strohel committed Mar 28, 2023
1 parent fa43bea commit 55beed3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ pub fn print_peer_diff(store: &DataStore, diff: &PeerDiff) {

pub fn all_installed(config_dir: &Path) -> Result<Vec<Interface>, std::io::Error> {
// All errors are bubbled up when enumerating a directory
let entries: Vec<_> = std::fs::read_dir(config_dir)?
.into_iter()
.collect::<Result<_, _>>()?;
let entries: Vec<_> = std::fs::read_dir(config_dir)?.collect::<Result<_, _>>()?;

let installed: Vec<_> = entries
.into_iter()
Expand Down

0 comments on commit 55beed3

Please sign in to comment.