diff --git a/src/diff/graph.rs b/src/diff/graph.rs index 1920662ef..c74e6a0fc 100644 --- a/src/diff/graph.rs +++ b/src/diff/graph.rs @@ -253,7 +253,10 @@ impl<'s, 'b> Vertex<'s, 'b> { self.lhs_syntax.is_none() && self.rhs_syntax.is_none() && self.parents.is_empty() } - pub(crate) fn new(lhs_syntax: Option<&'s Syntax<'s>>, rhs_syntax: Option<&'s Syntax<'s>>) -> Self { + pub(crate) fn new( + lhs_syntax: Option<&'s Syntax<'s>>, + rhs_syntax: Option<&'s Syntax<'s>>, + ) -> Self { let parents = Stack::new(); Vertex { neighbours: RefCell::new(None), diff --git a/src/diff/myers_diff.rs b/src/diff/myers_diff.rs index 0b3f83011..d404a3eed 100644 --- a/src/diff/myers_diff.rs +++ b/src/diff/myers_diff.rs @@ -15,7 +15,10 @@ pub(crate) enum DiffResult { /// Compute a linear diff between `lhs` and `rhs`. This is the /// traditional Myer's diff algorithm. -pub(crate) fn slice<'a, T: PartialEq + Clone>(lhs: &'a [T], rhs: &'a [T]) -> Vec> { +pub(crate) fn slice<'a, T: PartialEq + Clone>( + lhs: &'a [T], + rhs: &'a [T], +) -> Vec> { wu_diff::diff(lhs, rhs) .into_iter() .map(|result| match result { @@ -35,7 +38,10 @@ pub(crate) fn slice<'a, T: PartialEq + Clone>(lhs: &'a [T], rhs: &'a [T]) -> Vec /// /// This is faster when equality checks on `T` are expensive, such as /// large strings. -pub(crate) fn slice_by_hash<'a, T: Eq + Hash>(lhs: &'a [T], rhs: &'a [T]) -> Vec> { +pub(crate) fn slice_by_hash<'a, T: Eq + Hash>( + lhs: &'a [T], + rhs: &'a [T], +) -> Vec> { // Compute a unique numeric value for each item, use that for // diffing, then return diff results in terms of the original // type. diff --git a/src/display/context.rs b/src/display/context.rs index 88af360b2..23d567649 100644 --- a/src/display/context.rs +++ b/src/display/context.rs @@ -327,7 +327,9 @@ fn match_preceding_blanks( res } -pub(crate) fn opposite_positions(mps: &[MatchedPos]) -> DftHashMap> { +pub(crate) fn opposite_positions( + mps: &[MatchedPos], +) -> DftHashMap> { let mut res: DftHashMap> = DftHashMap::default(); for mp in mps {