Skip to content

Commit 2d0bfda

Browse files
authored
fix: update dependencies (#12)
* chore: update dependencies * chore: cargo clippy fix
1 parent c867ce1 commit 2d0bfda

File tree

3 files changed

+34
-37
lines changed

3 files changed

+34
-37
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ license = "MIT"
1313
doctest = false
1414

1515
[dependencies]
16-
crossterm = { version = "0.26", optional = true }
17-
termion = { version = "2.0", optional = true }
18-
pom = "3.3.0"
16+
crossterm = { version = "0.28", optional = true }
17+
termion = { version = "4.0", optional = true }
18+
pom = "3.4.0"
1919
serde = { version = "1.0", features = ["derive"] }
20-
strum = "0.25"
21-
strum_macros = "0.25"
20+
strum = "0.26"
21+
strum_macros = "0.26"
2222

2323
[features]
2424
default = ["crossterm"]
2525

2626
[dev-dependencies]
27-
toml = "0.7"
27+
toml = "0.8"
2828

2929
[[example]]
3030
name = "crossterm"

examples/crossterm.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,18 @@ fn read_event(stdout: &mut Stdout) -> io::Result<()> {
2626
loop {
2727
let event = read()?;
2828

29-
match event {
30-
Event::Key(key) => {
31-
if let Some((k, action)) = config.0.get_key_value(&KeyMap::from(key)) {
32-
if *action == Action::Quit {
33-
break;
34-
}
35-
36-
execute!(
37-
stdout,
38-
Print(format!("key:{} - {}\n", k, action)),
39-
cursor::MoveToNextLine(1),
40-
)?;
29+
if let Event::Key(key) = event {
30+
if let Some((k, action)) = config.0.get_key_value(&KeyMap::from(key)) {
31+
if *action == Action::Quit {
32+
break;
4133
}
34+
35+
execute!(
36+
stdout,
37+
Print(format!("key:{} - {}\n", k, action)),
38+
cursor::MoveToNextLine(1),
39+
)?;
4240
}
43-
_ => (),
4441
}
4542
}
4643

src/backend/crossterm.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ impl From<KeyEvent> for Node {
6060
impl<'a> From<&'a Node> for KeyEvent {
6161
fn from(node: &'a Node) -> Self {
6262
let key = match node.key {
63-
Keys::BackTab => KeyCode::BackTab.into(),
64-
Keys::Backspace => KeyCode::Backspace.into(),
65-
Keys::Char(c) => KeyCode::Char(c).into(),
66-
Keys::Delete => KeyCode::Delete.into(),
67-
Keys::Down => KeyCode::Down.into(),
68-
Keys::End => KeyCode::End.into(),
69-
Keys::Enter => KeyCode::Enter.into(),
70-
Keys::Esc => KeyCode::Esc.into(),
71-
Keys::F(n) => KeyCode::F(n).into(),
72-
Keys::Home => KeyCode::Home.into(),
73-
Keys::Insert => KeyCode::Insert.into(),
74-
Keys::Left => KeyCode::Left.into(),
75-
Keys::PageDown => KeyCode::PageDown.into(),
76-
Keys::PageUp => KeyCode::PageUp.into(),
77-
Keys::Right => KeyCode::Right.into(),
78-
Keys::Tab => KeyCode::Tab.into(),
79-
Keys::Space => KeyCode::Char(' ').into(),
80-
Keys::Up => KeyCode::Up.into(),
63+
Keys::BackTab => KeyCode::BackTab,
64+
Keys::Backspace => KeyCode::Backspace,
65+
Keys::Char(c) => KeyCode::Char(c),
66+
Keys::Delete => KeyCode::Delete,
67+
Keys::Down => KeyCode::Down,
68+
Keys::End => KeyCode::End,
69+
Keys::Enter => KeyCode::Enter,
70+
Keys::Esc => KeyCode::Esc,
71+
Keys::F(n) => KeyCode::F(n),
72+
Keys::Home => KeyCode::Home,
73+
Keys::Insert => KeyCode::Insert,
74+
Keys::Left => KeyCode::Left,
75+
Keys::PageDown => KeyCode::PageDown,
76+
Keys::PageUp => KeyCode::PageUp,
77+
Keys::Right => KeyCode::Right,
78+
Keys::Tab => KeyCode::Tab,
79+
Keys::Space => KeyCode::Char(' '),
80+
Keys::Up => KeyCode::Up,
8181
};
8282

8383
Self::new(key, NodeModifiers::from(node.modifiers).into())

0 commit comments

Comments
 (0)