]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/strings.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / strings.rs
index 7bc4e6515f65443ca105d66840486584fa259cf8..e15e80c1928e77c061cad0b33af3e3fbb56a1231 100644 (file)
@@ -7,13 +7,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-
-
-
 #[warn(clippy::string_add)]
 #[allow(clippy::string_add_assign)]
-fn add_only() { // ignores assignment distinction
+fn add_only() {
+    // ignores assignment distinction
     let mut x = "".to_owned();
 
     for _ in 1..3 {
@@ -59,12 +56,17 @@ fn both() {
 fn str_lit_as_bytes() {
     let bs = "hello there".as_bytes();
 
+    let bs = r###"raw string with three ### in it and some " ""###.as_bytes();
+
     // no warning, because this cannot be written as a byte string literal:
     let ubs = "☃".as_bytes();
 
     let strify = stringify!(foobar).as_bytes();
+
+    let includestr = include_str!("entry.rs").as_bytes();
 }
 
+#[allow(clippy::assign_op_pattern)]
 fn main() {
     add_only();
     add_assign_only();
@@ -72,6 +74,6 @@ fn main() {
 
     // the add is only caught for `String`
     let mut x = 1;
-    x = x + 1;
+    x = x + 1;
     assert_eq!(2, x);
 }