A few minor lints and docs (#1436)

* A few minor lints and docs

* Added required packages to compile on Debian-style linux
* Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline)
* a few spelling mistakes

* fix fmt
This commit is contained in:
Yuri Astrakhan
2023-10-18 23:33:10 -07:00
committed by GitHub
parent 67edac4aca
commit 3d4e3a74e5
51 changed files with 140 additions and 158 deletions
@@ -214,7 +214,7 @@ pub enum Key {
impl fmt::Display for Key {
// TODO: Relevant key labels should be localized when we get around to implementing localization/internationalization
fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
let key_name = format!("{:?}", self);
let key_name = format!("{self:?}");
// Writing system keys
const DIGIT_PREFIX: &str = "Digit";
@@ -293,14 +293,14 @@ impl fmt::Display for Key {
_ => key_name.as_str(),
};
write!(f, "{}", name)
write!(f, "{name}")
}
}
impl From<Key> for LayoutKey {
fn from(key: Key) -> Self {
Self {
key: format!("{:?}", key),
key: format!("{key:?}"),
label: key.to_string(),
}
}
@@ -356,7 +356,7 @@ impl fmt::Display for KeysGroup {
joined.truncate(joined.len() - JOINER_MARK.len());
}
write!(f, "{}", joined)
write!(f, "{joined}")
}
}
@@ -140,7 +140,7 @@ impl ActionKeys {
}
}
Self::Keys(keys) => {
warn!("Calling `.to_keys()` on a `ActionKeys::Keys` is a mistake/bug. Keys are: {:?}.", keys);
warn!("Calling `.to_keys()` on a `ActionKeys::Keys` is a mistake/bug. Keys are: {keys:?}.");
String::new()
}
}