colored-diff 0.2.3

Format the difference between two strings with ANSI colors
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate colored_diff;

fn main() {
    #[derive(Debug, PartialEq)]
    struct Foo {
        lorem: &'static str,
        ipsum: u32,
        dolor: Result<String, String>,
    }

    let x = Some(Foo { lorem: "Hello World!", ipsum: 42, dolor: Ok("hey".to_string())});
    let y = Some(Foo { lorem: "Hello Wrold!", ipsum: 42, dolor: Ok("hey ho!".to_string())});

    let x = format!("{:#?}", x);
    let y = format!("{:#?}", y);

    println!("{}", colored_diff::PrettyDifference { expected: &x, actual: &y })
}