change: More consistency improvements

This commit is contained in:
Sayantan Santra 2023-05-23 17:50:40 -05:00
parent 9456009b4d
commit 779064034a
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
2 changed files with 6 additions and 6 deletions

View File

@ -32,8 +32,8 @@ pub async fn process_file(
let mut parent = String::new();
if let Some(parts) = filename.rsplit_once('/') {
{
parent = parts.0.to_string();
file_base = parts.1.to_string();
parent = String::from(parts.0);
file_base = String::from(parts.1);
}
}

View File

@ -19,7 +19,7 @@ impl MovieEntry {
director: String::from("N/A"),
year: match movie.inner.release_date {
Some(date) => date.format("%Y").to_string(),
_ => "N/A".to_string(),
_ => String::from("N/A"),
},
language: get_long_lang(movie.inner.original_language.as_str()),
}
@ -34,7 +34,7 @@ impl MovieEntry {
title.truncate(159);
format = format.replace("{title}", title.as_str());
if self.year.as_str() != "N/A" {
if self.year != "N/A" {
format = format.replace("{year}", self.year.as_str());
} else {
format = format.replace("{year}", "");
@ -88,7 +88,7 @@ impl Language {
let mut list = Vec::new();
for lang in ["en", "hi", "bn", "fr", "ja", "de", "sp", "none"] {
list.push(Language {
short: lang.to_string(),
short: String::from(lang),
long: get_long_lang(lang),
});
}
@ -116,5 +116,5 @@ pub fn get_long_lang(short: &str) -> String {
"none" => "None",
other => other,
};
long.to_string()
String::from(long)
}