From 37304432374bd99a6354629d2769abd94f474c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 16 May 2021 10:44:38 +0100 Subject: [PATCH] Fix lints --- src/io/error_correcting_encoder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/error_correcting_encoder.rs b/src/io/error_correcting_encoder.rs index b502271..e37bcd1 100644 --- a/src/io/error_correcting_encoder.rs +++ b/src/io/error_correcting_encoder.rs @@ -38,7 +38,7 @@ pub fn decode(bytes: &[u8]) -> Result> { for buffer in decoded_blocks { for byte in buffer.data() { - result.push(byte.clone()); + result.push(*byte); } } @@ -88,7 +88,7 @@ mod must { let size = encoded.len(); let corrupt_byte_index = rand::thread_rng().gen_range::(0..size); - let mut corrupted = Vec::from(encoded); + let mut corrupted = encoded; corrupted[corrupt_byte_index] = rand::thread_rng().gen::(); let decoded = decode(&corrupted)?;