Updated Ratatui, created custom deserialization logic for i64s to make life easier, and used string interpolation where possible to reduce the lines needed to write log messages or create formatted text

This commit is contained in:
2023-09-07 17:20:38 -06:00
parent e13d1ece58
commit b16a58deae
43 changed files with 426 additions and 536 deletions
+3 -3
View File
@@ -28,8 +28,8 @@ pub enum Key {
impl Display for Key {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match *self {
Key::Char(c) => write!(f, "<{}>", c),
Key::Ctrl(c) => write!(f, "<ctrl-{}>", c),
Key::Char(c) => write!(f, "<{c}>"),
Key::Ctrl(c) => write!(f, "<ctrl-{c}>"),
Key::Up => write!(f, "<↑>"),
Key::Down => write!(f, "<↓>"),
Key::Left => write!(f, "<←>"),
@@ -41,7 +41,7 @@ impl Display for Key {
Key::End => write!(f, "<end>"),
Key::Tab => write!(f, "<tab>"),
Key::Delete => write!(f, "<del>"),
_ => write!(f, "<{:?}>", self),
_ => write!(f, "<{self:?}>"),
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ mod tests {
#[case(Key::Char('q'), "q")]
#[case(Key::Ctrl('q'), "ctrl-q")]
fn test_key_formatter(#[case] key: Key, #[case] expected_str: &str) {
assert_str_eq!(format!("{}", key), format!("<{}>", expected_str));
assert_str_eq!(format!("{key}"), format!("<{expected_str}>"));
}
#[test]