cli: Implement DDiff

Define types to support Diff of Diffs leaning on the Radicle Surf types.

Use Radicle Surf's Hunk type, but custom Diff, FileDiff, and
Modification types, and avoid Serde serialization as it does not yet
seem necessary.
This commit is contained in:
Slack Coder
2023-09-19 15:22:42 +02:00
committed by cloudhead
parent cb78f144be
commit 8e58ba6433
4 changed files with 436 additions and 3 deletions
+3 -3
View File
@@ -548,7 +548,7 @@ impl<'a> Writer<'a> {
self
}
fn write(&mut self, s: impl fmt::Display, style: term::Style) -> io::Result<()> {
pub fn write(&mut self, s: impl fmt::Display, style: term::Style) -> io::Result<()> {
if self.styled {
writeln!(self.stream, "{}", term::Paint::new(s).with_style(style))
} else {
@@ -556,11 +556,11 @@ impl<'a> Writer<'a> {
}
}
fn meta(&mut self, s: impl fmt::Display) -> io::Result<()> {
pub fn meta(&mut self, s: impl fmt::Display) -> io::Result<()> {
self.write(s, term::Style::new(term::Color::Yellow))
}
fn magenta(&mut self, s: impl fmt::Display) -> io::Result<()> {
pub fn magenta(&mut self, s: impl fmt::Display) -> io::Result<()> {
self.write(s, term::Style::new(term::Color::Magenta))
}
}