Files
rust/tests/ui/repeat_once.fixed
Guillaume Gomez f666fd6417 Update UI tests
2025-02-15 13:38:16 +01:00

22 lines
494 B
Rust

#![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
}