Procházet zdrojové kódy

util: Clippy lints

parazyd před 3 roky
rodič
revize
968550a680
2 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 6 0
      src/util/cli.rs
  2. 1 1
      src/util/ringbuffer.rs

+ 6 - 0
src/util/cli.rs

@@ -313,6 +313,12 @@ pub struct ProgressInc {
     timer: Arc<Mutex<Option<Instant>>>,
 }
 
+impl Default for ProgressInc {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
 impl ProgressInc {
     pub fn new() -> Self {
         eprint!("\x1b[?25l");

+ 1 - 1
src/util/ringbuffer.rs

@@ -69,7 +69,7 @@ impl<T: Eq + PartialEq + Clone, const N: usize> RingBuffer<T, N> {
 
     /// Cast the ringbuffer into a vec
     pub fn to_vec(&self) -> Vec<T> {
-        self.0.iter().map(|x| x.clone()).collect()
+        self.0.iter().cloned().collect()
     }
 }