Skip to content

Commit 277d0b5

Browse files
committed
Resolve clippy::single_char_add_str
error: calling `push_str()` using a single-character string literal --> src/diagnostics.rs:299:9 | 299 | helps.last_mut().unwrap().1.push_str("\n"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `helps.last_mut().unwrap().1.push('\n')` | = note: `-D clippy::single-char-add-str` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
1 parent 2f32221 commit 277d0b5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ fn report_msg<'mir, 'tcx>(
296296
// Show help messages.
297297
if !helps.is_empty() {
298298
// Add visual separator before backtrace.
299-
helps.last_mut().unwrap().1.push_str("\n");
299+
helps.last_mut().unwrap().1.push('\n');
300300
for (span_data, help) in helps {
301301
if let Some(span_data) = span_data {
302302
err.span_help(span_data.span(), &help);

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
clippy::manual_map,
2121
clippy::needless_lifetimes,
2222
clippy::new_without_default,
23-
clippy::single_char_add_str,
2423
clippy::single_char_pattern,
2524
clippy::single_match,
2625
clippy::unnecessary_mut_passed,

0 commit comments

Comments
 (0)