summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Ieni <11428655+MarcoIeni@users.noreply.github.com>2020-11-22 17:21:30 +0100
committerGitHub <noreply@github.com>2020-11-22 11:21:30 -0500
commit005e3568b95131f4aa2cae59fc30a513afb9b3a5 (patch)
treea8f3b8d41aa3ec7ce56f798840ba83e387b9f766
parent6358ee8592be74857b532bbf368bb3c1c027e4f9 (diff)
use push() instead of push_str() for single char (#394)
This solves a clippy warning
-rw-r--r--src/delta.rs2
-rw-r--r--src/features/side_by_side.rs4
-rw-r--r--src/paint.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/delta.rs b/src/delta.rs
index 2607d1c3..eb783e18 100644
--- a/src/delta.rs
+++ b/src/delta.rs
@@ -561,7 +561,7 @@ fn handle_hunk_line(
painter
.output_buffer
.push_str(&painter.expand_tabs(raw_line.graphemes(true)));
- painter.output_buffer.push_str("\n");
+ painter.output_buffer.push('\n');
State::HunkZero
}
}
diff --git a/src/features/side_by_side.rs b/src/features/side_by_side.rs
index 358261b8..a9abfb03 100644
--- a/src/features/side_by_side.rs
+++ b/src/features/side_by_side.rs
@@ -107,7 +107,7 @@ pub fn paint_minus_and_plus_lines_side_by_side<'a>(
background_color_extends_to_terminal_width,
config,
));
- output_buffer.push_str("\n");
+ output_buffer.push('\n');
}
}
@@ -171,7 +171,7 @@ pub fn paint_zero_lines_side_by_side(
config,
);
output_buffer.push_str(&right_panel_line);
- output_buffer.push_str("\n");
+ output_buffer.push('\n');
}
}
diff --git a/src/paint.rs b/src/paint.rs
index febe7a75..9171f231 100644
--- a/src/paint.rs
+++ b/src/paint.rs
@@ -292,7 +292,7 @@ impl<'a> Painter<'a> {
}
};
output_buffer.push_str(&line);
- output_buffer.push_str("\n");
+ output_buffer.push('\n');
}
}