match on chars instead of &strs for .split() or .strip_prefix()
This commit is contained in:
parent
cec34a43b1
commit
7a7708904b
5 changed files with 7 additions and 7 deletions
|
@ -15,11 +15,11 @@ struct Indentor<'a, 'b> {
|
|||
|
||||
impl Write for Indentor<'_, '_> {
|
||||
fn write_str(&mut self, s: &str) -> std::fmt::Result {
|
||||
for line in s.split_inclusive("\n") {
|
||||
for line in s.split_inclusive('\n') {
|
||||
if self.on_newline {
|
||||
self.f.write_str(" ")?;
|
||||
}
|
||||
self.on_newline = line.ends_with("\n");
|
||||
self.on_newline = line.ends_with('\n');
|
||||
self.f.write_str(line)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue