Skip to content

Commit 337f6b1

Browse files
committed
Apply pedantic Clippy lints
1 parent 0ffeb14 commit 337f6b1

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/app_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl AppState {
433433
.is_err()
434434
{
435435
break;
436-
};
436+
}
437437

438438
let success = exercise.run_exercise(None, &slf.cmd_runner);
439439
let progress = match success {

src/info_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct ExerciseInfo {
2323
#[serde(default)]
2424
pub skip_check_unsolved: bool,
2525
}
26-
#[inline(always)]
26+
#[inline]
2727
const fn default_true() -> bool {
2828
true
2929
}

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ fn main() -> Result<ExitCode> {
171171
stdout.write_all(b"\n")?;
172172

173173
return Ok(ExitCode::FAILURE);
174-
} else {
175-
app_state.render_final_message(&mut stdout)?;
176174
}
175+
176+
app_state.render_final_message(&mut stdout)?;
177177
}
178178
Some(Subcommands::Reset { name }) => {
179179
app_state.set_current_exercise_by_name(&name)?;

src/term.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,15 @@ pub fn progress_bar<'a>(
197197
total: u16,
198198
term_width: u16,
199199
) -> io::Result<()> {
200-
debug_assert!(total <= 999);
201-
debug_assert!(progress <= total);
202-
203200
const PREFIX: &[u8] = b"Progress: [";
204201
const PREFIX_WIDTH: u16 = PREFIX.len() as u16;
205202
const POSTFIX_WIDTH: u16 = "] xxx/xxx".len() as u16;
206203
const WRAPPER_WIDTH: u16 = PREFIX_WIDTH + POSTFIX_WIDTH;
207204
const MIN_LINE_WIDTH: u16 = WRAPPER_WIDTH + 4;
208205

206+
debug_assert!(total <= 999);
207+
debug_assert!(progress <= total);
208+
209209
if term_width < MIN_LINE_WIDTH {
210210
writer.write_ascii(b"Progress: ")?;
211211
// Integers are in ASCII.

src/watch/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a> WatchState<'a> {
6060
watch_event_sender,
6161
terminal_event_unpause_receiver,
6262
manual_run,
63-
)
63+
);
6464
})
6565
.context("Failed to spawn a thread to handle terminal events")?;
6666

src/watch/terminal_event.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn terminal_event_handler(
4747
// Pause input until quitting the confirmation prompt.
4848
if unpause_receiver.recv().is_err() {
4949
return;
50-
};
50+
}
5151

5252
continue;
5353
}
@@ -64,7 +64,7 @@ pub fn terminal_event_handler(
6464
return;
6565
}
6666
}
67-
Ok(Event::FocusGained | Event::FocusLost | Event::Mouse(_)) => continue,
67+
Ok(Event::FocusGained | Event::FocusLost | Event::Mouse(_)) => (),
6868
Err(e) => break WatchEvent::TerminalEventErr(e),
6969
}
7070
};

0 commit comments

Comments
 (0)