Remove unneeded .clone() call

`pattern` is a reference, and according to `cargo test` output: "the
type `[u8]` does not implement `Clone`, so calling `clone` on `&[u8]`
copies the reference, which does not do anything and can be removed".
This commit is contained in:
Pierre Lalet 2023-10-18 02:18:22 +02:00
parent 7406a1a191
commit b642c34e42

View file

@ -61,7 +61,7 @@ pub struct Smack {
}
fn make_copy_of_pattern(pattern: &[u8], is_nocase: bool) -> Vec<u8> {
let mut p = pattern.clone().to_vec();
let mut p = pattern.to_vec();
for i in 0..p.len() {
if is_nocase {
p[i] = p[i].to_ascii_lowercase();