use super::Color;
#[derive(Debug, Clone, Copy)]
pub struct Diff<Left, Right> {
pub left: Left,
pub right: Right,
pub color: Color,
pub unified: bool,
}
impl<Left, Right> Diff<Left, Right> {
pub const fn new(left: Left, right: Right) -> Self {
Diff {
left,
right,
color: Color::Always,
unified: true,
}
}
pub fn left<NewLeft>(self, left: NewLeft) -> Diff<NewLeft, Right> {
let Diff {
left: _,
right,
color,
unified,
} = self;
Diff {
left,
right,
color,
unified,
}
}
pub fn right<NewRight>(self, right: NewRight) -> Diff<Left, NewRight> {
let Diff {
left,
right: _,
color,
unified,
} = self;
Diff {
left,
right,
color,
unified,
}
}
pub const fn color(mut self, color: Color) -> Self {
self.color = color;
self
}
pub const fn unified(mut self, unified: bool) -> Self {
self.unified = unified;
self
}
}