mirror of
https://github.com/asciinema/asciinema.git
synced 2026-08-29 01:58:38 +02:00
Fix clippy warnings
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
_ => (),
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user