Fix clippy warnings

This commit is contained in:
Alexander Krotov
2019-12-03 17:57:06 +03:00
parent 74f36b264b
commit ad87b7c4a5
26 changed files with 285 additions and 374 deletions

View File

@@ -193,7 +193,7 @@ impl StockMessage {
/// Default untranslated strings for stock messages.
///
/// These could be used in logging calls, so no logging here.
fn fallback(&self) -> &'static str {
fn fallback(self) -> &'static str {
self.get_str("fallback").unwrap_or_default()
}
}
@@ -238,7 +238,7 @@ impl Context {
.unwrap()
.get(&(id as usize))
{
Some(ref x) => Cow::Owned(x.to_string()),
Some(ref x) => Cow::Owned((*x).to_string()),
None => Cow::Borrowed(id.fallback()),
}
}