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:
1 parent
e13d1ece58
commit
b16a58deae
43 files changed
+426
-536
No files matched your search
+3
-3
@@ -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:?}>"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user