Skip to content

Commit 4be598e

Browse files
committed
fix clippy: explicit_iter_loop
1 parent b13dba4 commit 4be598e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
let args: Vec<String> = env::args().collect();
1616
let mut patterns_filters: Vec<PatternFilter> = Vec::new();
1717

18-
for arg in args.iter() {
18+
for arg in &args {
1919
if arg.starts_with("--patterns=") {
2020
patterns_filters = create_patterns_filters(arg);
2121
}
@@ -76,7 +76,7 @@ fn create_patterns_filters(arg: &str) -> Vec<PatternFilter> {
7676

7777
let mut patterns_filters: Vec<PatternFilter> = Vec::new();
7878

79-
for pattern in patterns.iter() {
79+
for pattern in &patterns {
8080
let exclude = pattern.starts_with('!');
8181
let pattern = if exclude {
8282
pattern[1..].to_string()
@@ -137,7 +137,7 @@ fn get_changed_files() -> Vec<String> {
137137
fn filter_files(changed_files: &Vec<String>, include_patterns_filters: &HashSet<String>, exclude_patterns_filters: &HashSet<String>) -> HashSet<String> {
138138
let mut hash_set_filtered_files = HashSet::new();
139139

140-
for changed_file in changed_files.iter() {
140+
for changed_file in changed_files {
141141
include_patterns_filters.iter().for_each(|pattern| {
142142
if Pattern::new(pattern).expect("Failed to create pattern").matches(changed_file) {
143143
hash_set_filtered_files.insert(changed_file.to_string());

0 commit comments

Comments
 (0)