diff options
| author | mo8it <mo8it@proton.me> | 2024-05-13 02:45:12 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-05-13 02:45:12 +0200 |
| commit | 8b2d9ed50398c4c5c999ab9ab67757770449ed56 (patch) | |
| tree | 5709185f13e96ef67daca4673a14fc0092f705c1 /src/watch/state.rs | |
| parent | d2b5906be226f936481ff3a5cb8fccde5c721524 (diff) | |
Use PartialEq instead of matches!
Diffstat (limited to 'src/watch/state.rs')
| -rw-r--r-- | src/watch/state.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs index c21d7ca..74cf182 100644 --- a/src/watch/state.rs +++ b/src/watch/state.rs @@ -13,6 +13,7 @@ use crate::{ terminal_link::TerminalFileLink, }; +#[derive(PartialEq, Eq)] enum DoneStatus { DoneWithSolution(String), DoneWithoutSolution, @@ -77,7 +78,7 @@ impl<'a> WatchState<'a> { } pub fn next_exercise(&mut self) -> Result<ExercisesProgress> { - if matches!(self.done_status, DoneStatus::Pending) { + if self.done_status == DoneStatus::Pending { return Ok(ExercisesProgress::CurrentPending); } @@ -91,7 +92,7 @@ impl<'a> WatchState<'a> { write!(self.writer, "{}un/", 'r'.bold())?; } - if !matches!(self.done_status, DoneStatus::Pending) { + if self.done_status != DoneStatus::Pending { write!(self.writer, "{}ext/", 'n'.bold())?; } @@ -122,7 +123,7 @@ impl<'a> WatchState<'a> { )?; } - if !matches!(self.done_status, DoneStatus::Pending) { + if self.done_status != DoneStatus::Pending { writeln!( self.writer, "{}\n", |
