Show colored differences between source strings!
Inspired by / extracted from pretty-assertions and difference's github-style example
Powershell:
Command Prompt:
(Now accepting PRs for a macOS Terminal and/or Ubuntu (whatever console window) examples!)
```rust let expected = "\ Roses are red, violets are blue,\n\ I wrote this library here,\n\ just for you.\n\ (It's true).\n\ "; let actual = "\ Roses are red, violets are blue,\n\ I wrote this documentation here,\n\ just for you.\n\ (It's quite true).\n\ ";
coloreddiff::init(); println!("{}", coloreddiff::PrettyDifference { expected, actual }) ```
```rust
struct Foo {
lorem: &'static str,
ipsum: u32,
dolor: Result
let x = Some(Foo { lorem: "Hello World!", ipsum: 42, dolor: Ok("hey".tostring())}); let y = Some(Foo { lorem: "Hello Wrold!", ipsum: 42, dolor: Ok("hey ho!".tostring())});
let x = format!("{:#?}", x); let y = format!("{:#?}", y);
coloreddiff::init(); println!("{}", coloreddiff::PrettyDifference { expected: &x, actual: &y }) ```