about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/repeat_once.fixed
blob: e739e176f0acd8584b95abf010ff98e099667a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![warn(clippy::repeat_once)]
#[allow(unused, clippy::redundant_clone)]
fn main() {
    const N: usize = 1;
    let s = "str";
    let string = "String".to_string();
    let slice = [1; 5];

    let a = [1; 5].to_vec();
    //~^ repeat_once
    let b = slice.to_vec();
    //~^ repeat_once
    let c = "hello".to_string();
    //~^ repeat_once
    let d = "hi".to_string();
    //~^ repeat_once
    let e = s.to_string();
    //~^ repeat_once
    let f = string.clone();
    //~^ repeat_once
}