From 2dd4f7e9120b66545199b16c86a24efacf92d75b Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 15 Oct 2024 08:37:18 -0700 Subject: [PATCH] Add doc comment --- src/line_parser.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/line_parser.rs b/src/line_parser.rs index dfea571f2..226c2a8d9 100644 --- a/src/line_parser.rs +++ b/src/line_parser.rs @@ -150,7 +150,12 @@ fn line_len_in_bytes(line: &str) -> usize { } } -// TODO: Prefer src/opposite_src nomenclature as this function is called from both sides. +/// Build a vec of MatchedPos, performing a textual diff. Match up +/// unchanged lines, and match up unchanged words within novel lines. +/// +/// The resulting vec only has novel items from the LHS. Callers +/// should do `change_positions(rhs_src, lhs_src)` to obtain +/// novel MatchedPos values for the RHS. pub(crate) fn change_positions(lhs_src: &str, rhs_src: &str) -> Vec { // TODO: If either side is "", don't split each line by words // pointlessly. This is common for file additions/removals.