From 968550a68064384f388fa4b2e498fa38efd891e3 Mon Sep 17 00:00:00 2001 From: parazyd Date: Sat, 8 Jul 2023 21:19:27 +0200 Subject: [PATCH] util: Clippy lints --- src/util/cli.rs | 6 ++++++ src/util/ringbuffer.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/cli.rs b/src/util/cli.rs index 0af845a4c..d9d947598 100644 --- a/src/util/cli.rs +++ b/src/util/cli.rs @@ -313,6 +313,12 @@ pub struct ProgressInc { timer: Arc>>, } +impl Default for ProgressInc { + fn default() -> Self { + Self::new() + } +} + impl ProgressInc { pub fn new() -> Self { eprint!("\x1b[?25l"); diff --git a/src/util/ringbuffer.rs b/src/util/ringbuffer.rs index 66b5b0a11..c571b37fd 100644 --- a/src/util/ringbuffer.rs +++ b/src/util/ringbuffer.rs @@ -69,7 +69,7 @@ impl RingBuffer { /// Cast the ringbuffer into a vec pub fn to_vec(&self) -> Vec { - self.0.iter().map(|x| x.clone()).collect() + self.0.iter().cloned().collect() } }