about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/byte_char_slices.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/byte_char_slices.fixed')
-rw-r--r--src/tools/clippy/tests/ui/byte_char_slices.fixed13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/byte_char_slices.fixed b/src/tools/clippy/tests/ui/byte_char_slices.fixed
new file mode 100644
index 00000000000..d1db58f9363
--- /dev/null
+++ b/src/tools/clippy/tests/ui/byte_char_slices.fixed
@@ -0,0 +1,13 @@
+#![allow(unused)]
+#![warn(clippy::byte_char_slices)]
+
+fn main() {
+    let bad = b"abc";
+    let quotes = b"\"Hi";
+    let quotes = b"'Sup";
+    let escapes = b"\x42Esc";
+
+    let good = &[b'a', 0x42];
+    let good = [b'a', b'a'];
+    let good: u8 = [b'a', b'c'].into_iter().sum();
+}