]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/repeat_once.fixed
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / repeat_once.fixed
diff --git a/src/tools/clippy/tests/ui/repeat_once.fixed b/src/tools/clippy/tests/ui/repeat_once.fixed
new file mode 100644 (file)
index 0000000..a637c22
--- /dev/null
@@ -0,0 +1,16 @@
+// run-rustfix
+#![warn(clippy::repeat_once)]
+#[allow(unused, clippy::many_single_char_names, 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();
+    let b = slice.to_vec();
+    let c = "hello".to_string();
+    let d = "hi".to_string();
+    let e = s.to_string();
+    let f = string.clone();
+}