From fb317aaf9e90cb3ca5ce0a9f48b1b36cf231f162 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 1 Sep 2018 16:40:49 -0700 Subject: [PATCH] tidy: cargo.rs: Clean up loop to use "for" instead of "while let" Eliminates a clippy warning. Also drop the unnecessary `.peekable()`. --- src/tools/tidy/src/cargo.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/tidy/src/cargo.rs b/src/tools/tidy/src/cargo.rs index 1f0379f1ea80..69f61bc248db 100644 --- a/src/tools/tidy/src/cargo.rs +++ b/src/tools/tidy/src/cargo.rs @@ -65,8 +65,7 @@ fn verify(tomlfile: &Path, libfile: &Path, bad: &mut bool) { Some(i) => &toml[i+1..], None => return, }; - let mut lines = deps.lines().peekable(); - while let Some(line) = lines.next() { + for line in deps.lines() { if line.starts_with('[') { break }