]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/repeat_once.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / repeat_once.rs
CommitLineData
f20569fa
XL
1// run-rustfix
2#![warn(clippy::repeat_once)]
3#[allow(unused, clippy::many_single_char_names, clippy::redundant_clone)]
4fn main() {
5 const N: usize = 1;
6 let s = "str";
7 let string = "String".to_string();
8 let slice = [1; 5];
9
10 let a = [1; 5].repeat(1);
11 let b = slice.repeat(1);
12 let c = "hello".repeat(N);
13 let d = "hi".repeat(1);
14 let e = s.repeat(1);
15 let f = string.repeat(1);
16}