5 clippy::redundant_clone,
8 clippy::unnecessary_operation,
9 clippy::vec_init_then_push,
10 clippy::toplevel_ref_arg,
11 clippy::needless_borrow
14 use std::cell::RefCell;
15 use std::rc::{self, Rc};
16 use std::sync::{self, Arc};
20 fn is_ascii(ch: char) -> bool {
27 vec![1].clone(); // ok, not a Copy type
28 Some(vec![1]).clone(); // ok, not a Copy type
31 let rc = RefCell::new(0);
35 x.clone().rotate_left(1);
37 #[derive(Clone, Copy)]
40 fn clone(&self) -> u32 {
44 Foo.clone(); // ok, this is not the clone trait
47 ($e:expr) => {{ $e }};
51 struct Wrap([u32; 2]);
52 impl core::ops::Deref for Wrap {
53 type Target = [u32; 2];
54 fn deref(&self) -> &[u32; 2] {
62 let ref y = x.clone(); // ok, binds by reference
63 let ref mut y = x.clone(); // ok, binds by reference
67 let _ = &x.clone(); // ok, getting a ref
68 'a'.clone().make_ascii_uppercase(); // ok, clone and then mutate
69 is_ascii('z'.clone());
72 let mut vec = Vec::new();