Cleaning the empty lines for clarity.
fn str_lit_as_bytes() {
let bs = "hello there".as_bytes();
-
-
-
// no warning, because this cannot be written as a byte string literal:
let ubs = "☃".as_bytes();
// the add is only caught for `String`
let mut x = 1;
; x = x + 1;
-
-
-
assert_eq!(2, x);
}
| ^^^^^^^^^^^^^^^^^^^
warning: manual implementation of an assign operation
- --> $DIR/strings.rs:68:7
+ --> $DIR/strings.rs:65:7
|
-68 | ; x = x + 1;
+65 | ; x = x + 1;
| ^^^^^^^^^ help: replace it with `x += 1`
|
= note: #[warn(assign_op_pattern)] on by default