chore: remove trivial single-use helper functions
This commit is contained in:
@@ -253,7 +253,12 @@ impl PatchParser {
|
||||
kind,
|
||||
old: old_no,
|
||||
new: new_no,
|
||||
text: Self::line_text(text),
|
||||
text: text
|
||||
.strip_suffix('\n')
|
||||
.unwrap_or(text)
|
||||
.strip_suffix('\r')
|
||||
.unwrap_or(text)
|
||||
.to_owned(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -265,11 +270,6 @@ impl PatchParser {
|
||||
lines,
|
||||
}
|
||||
}
|
||||
|
||||
fn line_text(text: &str) -> String {
|
||||
let text = text.strip_suffix('\n').unwrap_or(text);
|
||||
text.strip_suffix('\r').unwrap_or(text).to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
// A `git format-patch` mbox message, split on its `From <40-hex> <date>` envelope.
|
||||
|
||||
Reference in New Issue
Block a user