cleared up clippy lints

This commit is contained in:
2021-07-17 17:00:47 +01:00
parent 1556318d07
commit 43bbcb3fe0
9 changed files with 371 additions and 320 deletions

View File

@ -14,7 +14,7 @@ pub struct LanguageManager {
impl LanguageManager {
pub fn from_compiled(content: &'static str) -> Result<Self, Box<dyn Error + Send + Sync>> {
let new: Self = from_str(content.as_ref())?;
let new: Self = from_str(content)?;
Ok(new)
}
@ -23,13 +23,13 @@ impl LanguageManager {
self.strings
.get(language)
.map(|sm| sm.get(name))
.expect(&format!(r#"Language does not exist: "{}""#, language))
.unwrap_or_else(|| panic!(r#"Language does not exist: "{}""#, language))
.unwrap_or_else(|| {
self.strings
.get(&*LOCAL_LANGUAGE)
.map(|sm| {
sm.get(name)
.expect(&format!(r#"String does not exist: "{}""#, name))
.unwrap_or_else(|| panic!(r#"String does not exist: "{}""#, name))
})
.expect("LOCAL_LANGUAGE is not available")
})