From 99f357f780c5660ade776e12e7b57d206f72b41e Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Mon, 5 Jul 2021 23:08:14 -0700 Subject: [PATCH] Make function public and prefer references to hashmap of matched lines --- src/syntax.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/syntax.rs b/src/syntax.rs index a19d8cbf01..cddc2f470f 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -551,11 +551,11 @@ fn zip_lines(lhs: &[SingleLineSpan], rhs: &[SingleLineSpan]) -> Vec<(LineNumber, .collect() } -fn aligned_lines( +pub fn aligned_lines( lhs_lines: &[LineNumber], rhs_lines: &[LineNumber], - lhs_line_matches: HashMap, - rhs_line_matches: HashMap, + lhs_line_matches: &HashMap, + rhs_line_matches: &HashMap, ) -> Vec<(Option, Option)> { // Find RHS lines that we can match up. let mut lhs_opposite_lines = vec![]; @@ -611,7 +611,7 @@ fn aligned_lines( res } -fn matching_lines<'a>(nodes: &[Syntax<'a>]) -> HashMap { +pub fn matching_lines<'a>(nodes: &[&Syntax<'a>]) -> HashMap { let mut res = HashMap::new(); for node in nodes { matching_lines_(node, &mut res);