Skip to content

Commit aca32ba

Browse files
committed
Add doc comments
1 parent b666424 commit aca32ba

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/diff/changes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ use crate::{
77

88
#[derive(PartialEq, Eq, Clone, Copy)]
99
pub(crate) enum ChangeKind<'a> {
10+
/// This node is shallowly unchanged. For lists, this means that
11+
/// the delimiters match, but there may still be some differences
12+
/// in the children between LHS and RHS.
1013
Unchanged(&'a Syntax<'a>),
1114
ReplacedComment(&'a Syntax<'a>, &'a Syntax<'a>),
1215
ReplacedString(&'a Syntax<'a>, &'a Syntax<'a>),

src/display/hunks.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ fn extract_lines(hunk: &Hunk) -> Vec<(Option<LineNumber>, Option<LineNumber>)> {
130130
relevant
131131
}
132132

133+
/// If any hunks are sufficiently close that they have overlapping
134+
/// lines, merge them.
135+
///
136+
/// For example, given a hunk from lines 8-10 and a hunk from lines
137+
/// 12-15 with 5 context lines, combine the two hunks.
133138
pub(crate) fn merge_adjacent(
134139
hunks: &[Hunk],
135140
opposite_to_lhs: &DftHashMap<LineNumber, DftHashSet<LineNumber>>,

0 commit comments

Comments
 (0)