From 42acf69ba0da83678ad6ae168af4f804487c671c Mon Sep 17 00:00:00 2001 From: ls Date: Fri, 25 Oct 2024 16:55:08 +0200 Subject: [PATCH] clippy: use array rather than vec --- main/src/project.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/project.rs b/main/src/project.rs index 0f0fd4e..5de4872 100644 --- a/main/src/project.rs +++ b/main/src/project.rs @@ -457,15 +457,15 @@ mod test { let dir = tempdir()?; let dir_path = dir.path(); - let files = vec!["file.rs", "ignore.me", "Cargo.toml", "Cargo.lock"]; - for file in files.iter() { + let files = ["file.rs", "ignore.me", "Cargo.toml", "Cargo.lock"]; + for file in files { let file_path = dir_path.join(file); let mut file = File::create(&file_path)?; writeln!(file, "Test content")?; } - let dirs = vec!["nested", ".git", "target"]; - for d in dirs.iter() { + let dirs = ["nested", ".git", "target"]; + for d in dirs { let subdir_path = dir_path.join(d); if !subdir_path.exists() { fs::create_dir(&subdir_path)?;