Fix clippy warnings

This commit is contained in:
Marcin Kulik
2026-07-26 20:36:56 +00:00
parent 14fce35475
commit a7d33677da
5 changed files with 12 additions and 16 deletions

View File

@@ -246,7 +246,7 @@ fn format_duration(duration: Duration) -> String {
let secs = time_ms / 1_000;
let millis = time_ms % 1_000;
format!("{}.{}", secs, format!("{:03}", millis))
format!("{secs}.{millis:03}")
}
impl serde::Serialize for V3Header {

View File

@@ -272,11 +272,9 @@ fn parse_key<S: AsRef<str>>(key: S) -> Result<Key> {
}
}
3 => {
if chars[0].eq_ignore_ascii_case(&'C') && ['+', '-'].contains(&chars[1]) {
if let Some(key) = parse_control_key(chars[2]) {
return Ok(Some(vec![key]));
}
3 if chars[0].eq_ignore_ascii_case(&'C') && ['+', '-'].contains(&chars[1]) => {
if let Some(key) = parse_control_key(chars[2]) {
return Ok(Some(vec![key]));
}
}

View File

@@ -23,7 +23,7 @@ pub fn check_utf8_locale() -> anyhow::Result<()> {
pub fn initialize_from_env() {
unsafe {
libc::setlocale(LC_ALL, b"\0".as_ptr() as *const libc::c_char);
libc::setlocale(LC_ALL, c"".as_ptr());
};
}

View File

@@ -132,12 +132,10 @@ pub async fn play(
tty.resize((*cols as usize, *rows as usize).into()).await?;
}
EventData::Marker(_) => {
if pause_on_markers {
pause_elapsed_time = Some(time.as_micros() as u64);
next_event = events.recv().await.transpose()?;
break;
}
EventData::Marker(_) if pause_on_markers => {
pause_elapsed_time = Some(time.as_micros() as u64);
next_event = events.recv().await.transpose()?;
break;
}
_ => (),

View File

@@ -149,9 +149,9 @@ mod tests {
let mut quantizer = Quantizer::new(1_000);
let input = [
026692, 540290, 064736, 105951, 171006, 191943, 107942, 128108, 148904, 108973, 211002,
044701, 489307, 405987, 105028, 194590, 061043, 532296, 319015, 152786, 032578, 005445,
040542, 000756,
26692, 540290, 64736, 105951, 171006, 191943, 107942, 128108, 148904, 108973, 211002,
44701, 489307, 405987, 105028, 194590, 61043, 532296, 319015, 152786, 32578, 5445,
40542, 756,
];
let expected = [