Document structs used to track lines

ida_star
Wilfred Hughes 2021-07-30 01:07:51 +07:00
parent 27c43308c3
commit daa6ac3f3b
1 changed files with 5 additions and 0 deletions

@ -11,6 +11,8 @@ const SPACER: &str = " ";
const MAX_GAP: usize = 1;
const MIN_WIDTH: usize = 35;
/// A distinct number type for line numbers, to prevent confusion with
/// other numerical data.
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct LineNumber(pub usize);
@ -26,6 +28,9 @@ impl From<usize> for LineNumber {
}
}
/// A group of lines that are displayed together.
///
/// This is called a 'hunk' in some diff tools.
#[derive(Debug, PartialEq, Eq)]
pub struct LineGroup {
lhs_lines: Option<Interval<LineNumber>>,