1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// Settings for the diffing process
#[derive(Debug,Clone,Copy)]
pub struct Settings {
    /// How to align the bytes: Given two offsets, returns the offset to align to.
    pub align: fn(usize, usize) -> usize,
    /// The width of a single line
    pub width: usize,
    /// How many lines to include before a diff as context.
    pub before: usize,
    /// How many lines to include after a diff as context.
    pub after: usize
}

/// Align to the left file.
pub const ALIGN_LEFT: fn(usize, usize) -> usize = |left, _right| left;
/// Align to the right file.
pub const ALIGN_RIGHT: fn(usize, usize) -> usize = |_left, right| right;

/// Default settings.
pub const DEFAULT_SETTINGS: Settings = Settings { align: ALIGN_LEFT, width: 16, before: 3, after: 3 };