Skip to content

Commit

Permalink
Add whitespace in the huge action match
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoRiether committed Feb 7, 2024
1 parent 77f124c commit 9e69be2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tori/src/update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
Quit => {
state.quit();
}

SeekForward => {
state.player.seek(10.)?;
return Ok(Some(Action::Tick));
Expand All @@ -93,6 +94,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
state.player.seek(-10.)?;
return Ok(Some(Action::Tick));
}

NextSong => {
state
.player
Expand All @@ -107,6 +109,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
.unwrap_or_else(|_| state.notify_err("No previous song"));
return Ok(Some(Action::Tick));
}

TogglePause => {
state.player.toggle_pause()?;
return Ok(Some(Action::Tick));
Expand All @@ -115,6 +118,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
state.player.toggle_loop_file()?;
return Ok(Some(Action::Tick));
}

VolumeUp => {
state.player.add_volume(5)?;
return Ok(Some(Action::Tick));
Expand All @@ -127,6 +131,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
state.player.toggle_mute()?;
return Ok(Some(Action::Tick));
}

OpenInBrowser => todo!(),
CopyUrl => todo!(),
CopyTitle => todo!(),
Expand All @@ -139,6 +144,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
SwapSongDown => todo!(),
SwapSongUp => todo!(),
Shuffle => todo!(),

SelectNext => match &mut state.screen {
Screen::BrowseScreen(screen) => screen.select_next()?,
},
Expand All @@ -151,6 +157,7 @@ fn handle_command(state: &mut State<'_>, _tx: Tx, cmd: Command) -> Result<Option
SelectRight => match &mut state.screen {
Screen::BrowseScreen(screen) => screen.focus = Focus::Songs,
},

Add => todo!(),
QueueSong => todo!(),
QueueShown => todo!(),
Expand Down

0 comments on commit 9e69be2

Please sign in to comment.