cli: Implement pretty diffs with highlighting

Implements a new kind of diff output that includes syntax highlighting.
This type of diff will be used for code review.
This commit is contained in:
cloudhead
2023-09-27 12:37:41 +02:00
parent 7abfd4870c
commit 90fe50c152
7 changed files with 869 additions and 2 deletions
+6 -1
View File
@@ -148,7 +148,12 @@ pub trait Decode: Sized {
/// Decode from a string input.
fn parse(s: &str) -> Result<Self, Error> {
let mut r = io::BufReader::new(s.as_bytes());
Self::from_bytes(s.as_bytes())
}
/// Decode from a string input.
fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
let mut r = io::BufReader::new(bytes);
Self::decode(&mut r)
}
}