mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-25 19:58:36 -06:00
change: Do not dereference str when possible
This commit is contained in:
parent
779064034a
commit
5e5ba7ea0a
2 changed files with 5 additions and 5 deletions
|
@ -146,7 +146,7 @@ pub async fn process_file(
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the new name
|
// Create the new name
|
||||||
new_name_base = choice.rename_format(pattern.to_string());
|
new_name_base = choice.rename_format(String::from(pattern));
|
||||||
} else {
|
} else {
|
||||||
println!(" Using previous choice for related files...");
|
println!(" Using previous choice for related files...");
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ pub async fn process_file(
|
||||||
new_name_with_ext = format!("{new_name_with_ext}.{extension}");
|
new_name_with_ext = format!("{new_name_with_ext}.{extension}");
|
||||||
}
|
}
|
||||||
let mut new_name = new_name_with_ext.clone();
|
let mut new_name = new_name_with_ext.clone();
|
||||||
if parent != *"" {
|
if !parent.is_empty() {
|
||||||
new_name = format!("{parent}/{new_name}");
|
new_name = format!("{parent}/{new_name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ async fn main() {
|
||||||
let (entries, settings) = process_args(args);
|
let (entries, settings) = process_args(args);
|
||||||
|
|
||||||
// Try to read config file, or display error
|
// Try to read config file, or display error
|
||||||
let mut config_file = env::var("XDG_CONFIG_HOME").unwrap_or("$HOME".to_string());
|
let mut config_file = env::var("XDG_CONFIG_HOME").unwrap_or(String::from("$HOME"));
|
||||||
if config_file == *"$HOME" {
|
if config_file == "$HOME" {
|
||||||
config_file = env::var("$HOME").unwrap();
|
config_file = env::var("$HOME").unwrap();
|
||||||
config_file.push_str("/.config");
|
config_file.push_str("/.config");
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ async fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create TMDb object for API calls
|
// Create TMDb object for API calls
|
||||||
let tmdb = Client::new(api_key.to_string());
|
let tmdb = Client::new(String::from(api_key));
|
||||||
|
|
||||||
// Iterate over entries
|
// Iterate over entries
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
|
|
Loading…
Reference in a new issue