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)?;