chore: remove trivial single-use helper functions
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-10-06 10:20:28 +07:00
parent a4df8e5731
commit cd72b25626
14 changed files with 58 additions and 130 deletions
+6 -6
View File
@@ -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.