Skip to content

Commit

Permalink
clippy: use array rather than vec
Browse files Browse the repository at this point in the history
  • Loading branch information
ls committed Oct 25, 2024
1 parent 7702df6 commit 42acf69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit 42acf69

Please sign in to comment.