mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 18:40:39 +08:00
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:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user