fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: useless use of `format!` 2 --> $DIR/format.rs:20:5 3 | 4LL | format!("foo"); 5 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()` 6 | 7 = note: `-D clippy::useless-format` implied by `-D warnings` 8 = help: to override `-D warnings` add `#[allow(clippy::useless_format)]` 9 10error: useless use of `format!` 11 --> $DIR/format.rs:21:5 12 | 13LL | format!("{{}}"); 14 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()` 15 16error: useless use of `format!` 17 --> $DIR/format.rs:22:5 18 | 19LL | format!("{{}} abc {{}}"); 20 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()` 21 22error: useless use of `format!` 23 --> $DIR/format.rs:23:5 24 | 25LL | / format!( 26LL | | r##"foo {{}} 27LL | | " bar"## 28LL | | ); 29 | |_____^ 30 | 31help: consider using `.to_string()` 32 | 33LL ~ r##"foo {} 34LL ~ " bar"##.to_string(); 35 | 36 37error: useless use of `format!` 38 --> $DIR/format.rs:28:13 39 | 40LL | let _ = format!(""); 41 | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` 42 43error: useless use of `format!` 44 --> $DIR/format.rs:30:5 45 | 46LL | format!("{}", "foo"); 47 | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()` 48 49error: useless use of `format!` 50 --> $DIR/format.rs:38:5 51 | 52LL | format!("{}", arg); 53 | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()` 54 55error: useless use of `format!` 56 --> $DIR/format.rs:68:5 57 | 58LL | format!("{}", 42.to_string()); 59 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()` 60 61error: useless use of `format!` 62 --> $DIR/format.rs:70:5 63 | 64LL | format!("{}", x.display().to_string()); 65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()` 66 67error: useless use of `format!` 68 --> $DIR/format.rs:74:18 69 | 70LL | let _ = Some(format!("{}", a + "bar")); 71 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"` 72 73error: useless use of `format!` 74 --> $DIR/format.rs:78:22 75 | 76LL | let _s: String = format!("{}", &*v.join("\n")); 77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("\n")).to_string()` 78 79error: useless use of `format!` 80 --> $DIR/format.rs:84:13 81 | 82LL | let _ = format!("{x}"); 83 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()` 84 85error: useless use of `format!` 86 --> $DIR/format.rs:86:13 87 | 88LL | let _ = format!("{y}", y = x); 89 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()` 90 91error: useless use of `format!` 92 --> $DIR/format.rs:90:13 93 | 94LL | let _ = format!("{abc}"); 95 | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()` 96 97error: useless use of `format!` 98 --> $DIR/format.rs:92:13 99 | 100LL | let _ = format!("{xx}"); 101 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()` 102 103error: aborting due to 15 previous errors 104