From bea15b8ebd0ee83076e00d882c85819f58fed4c9 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 28 Jun 2021 14:18:36 +0200 Subject: [PATCH] tutorials/13: Use nested or patterns, available since Rust 1.53 --- tutorials/src/bin/basic-tutorial-13.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tutorials/src/bin/basic-tutorial-13.rs b/tutorials/src/bin/basic-tutorial-13.rs index 2247fd141..e0f99d6cb 100644 --- a/tutorials/src/bin/basic-tutorial-13.rs +++ b/tutorials/src/bin/basic-tutorial-13.rs @@ -80,13 +80,13 @@ fn handle_keyboard(ready_tx: glib::Sender) { loop { if let Some(Ok(input)) = stdin.next() { let command = match input { - Key::Char('p') | Key::Char('P') => Command::PlayPause, + Key::Char('p' | 'P') => Command::PlayPause, Key::Char('s') => Command::DataRateDown, Key::Char('S') => Command::DataRateUp, - Key::Char('d') | Key::Char('D') => Command::ReverseRate, - Key::Char('n') | Key::Char('N') => Command::NextFrame, - Key::Char('q') | Key::Char('Q') => Command::Quit, - Key::Ctrl('c') | Key::Ctrl('C') => Command::Quit, + Key::Char('d' | 'D') => Command::ReverseRate, + Key::Char('n' | 'N') => Command::NextFrame, + Key::Char('q' | 'Q') => Command::Quit, + Key::Ctrl('c' | 'C') => Command::Quit, _ => continue, }; ready_tx