refactor: add gif to extra_files and bypass array length specification
This commit is contained in:
+2
-3
@@ -12,7 +12,7 @@ use std::path::PathBuf;
|
||||
pub fn move_files(
|
||||
file_path: PathBuf,
|
||||
tag: Tag,
|
||||
extra_files: [String; 9],
|
||||
extra_files: &[String],
|
||||
should_copy: bool,
|
||||
has_parent: bool,
|
||||
add_new_playlist: bool,
|
||||
@@ -64,7 +64,7 @@ pub fn move_files(
|
||||
new_playlist(target.join(file_name))?;
|
||||
}
|
||||
|
||||
for ext in &extra_files {
|
||||
for ext in extra_files {
|
||||
let pattern = file_path.parent().unwrap().join(format!("*.{}", ext));
|
||||
|
||||
let paths: Vec<_> = glob(pattern.to_str().unwrap())?.collect::<Result<_, _>>()?;
|
||||
@@ -109,7 +109,6 @@ fn new_playlist(path: PathBuf) -> std::result::Result<(), std::io::Error> {
|
||||
.append(true)
|
||||
.open(new_playlist_path)
|
||||
.unwrap();
|
||||
println!("{:?}", path);
|
||||
writeln!(new_playlist, "{}", path.display())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user