Changed Ctrl-r to ctrl-r for displaying key mappings
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ impl Display for Key {
|
|||||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
Key::Char(c) => write!(f, "<{}>", c),
|
Key::Char(c) => write!(f, "<{}>", c),
|
||||||
Key::Ctrl(c) => write!(f, "<Ctrl-{}>", c),
|
Key::Ctrl(c) => write!(f, "<ctrl-{}>", c),
|
||||||
Key::Up => write!(f, "<↑>"),
|
Key::Up => write!(f, "<↑>"),
|
||||||
Key::Down => write!(f, "<↓>"),
|
Key::Down => write!(f, "<↓>"),
|
||||||
Key::Left => write!(f, "<←>"),
|
Key::Left => write!(f, "<←>"),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ mod tests {
|
|||||||
#[case(Key::Tab, "tab")]
|
#[case(Key::Tab, "tab")]
|
||||||
#[case(Key::Delete, "del")]
|
#[case(Key::Delete, "del")]
|
||||||
#[case(Key::Char('q'), "q")]
|
#[case(Key::Char('q'), "q")]
|
||||||
#[case(Key::Ctrl('q'), "Ctrl-q")]
|
#[case(Key::Ctrl('q'), "ctrl-q")]
|
||||||
fn test_key_formatter(#[case] key: Key, #[case] expected_str: &str) {
|
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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user