diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2023-10-22 12:45:06 -0500 |
|---|---|---|
| committer | Caleb Cartwright <caleb.cartwright@outlook.com> | 2023-10-22 12:45:06 -0500 |
| commit | f35f25287fea7d45cb05764e5d8b0a3a4e4ab2cd (patch) | |
| tree | bd7f33be19074b7fe3bfe4431645078cb73b1951 /src/rustfmt_diff.rs | |
| parent | 4b5ef37e217d98de6ea3cef71aea9f47c2e9ce23 (diff) | |
| parent | 547577fa5d309d90292ca3a58fef1bf0d9325cc0 (diff) | |
| download | rust-f35f25287fea7d45cb05764e5d8b0a3a4e4ab2cd.tar.gz rust-f35f25287fea7d45cb05764e5d8b0a3a4e4ab2cd.zip | |
Merge remote-tracking branch 'upstream/master' into subtree-sync-2023-10-22
Diffstat (limited to 'src/rustfmt_diff.rs')
| -rw-r--r-- | src/rustfmt_diff.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index 1724a0f87bf..c9883452185 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -95,7 +95,7 @@ impl fmt::Display for ModifiedLines { )?; for line in &chunk.lines { - writeln!(f, "{}", line)?; + writeln!(f, "{line}")?; } } @@ -166,12 +166,12 @@ impl OutputWriter { if let Some(color) = color { t.fg(color).unwrap(); } - writeln!(t, "{}", msg).unwrap(); + writeln!(t, "{msg}").unwrap(); if color.is_some() { t.reset().unwrap(); } } - None => println!("{}", msg), + None => println!("{msg}"), } } } @@ -265,16 +265,15 @@ where for line in mismatch.lines { match line { DiffLine::Context(ref str) => { - writer.writeln(&format!(" {}{}", str, line_terminator), None) + writer.writeln(&format!(" {str}{line_terminator}"), None) } DiffLine::Expected(ref str) => writer.writeln( - &format!("+{}{}", str, line_terminator), + &format!("+{str}{line_terminator}"), Some(term::color::GREEN), ), - DiffLine::Resulting(ref str) => writer.writeln( - &format!("-{}{}", str, line_terminator), - Some(term::color::RED), - ), + DiffLine::Resulting(ref str) => { + writer.writeln(&format!("-{str}{line_terminator}"), Some(term::color::RED)) + } } } } |
