Structural diffing and assertions for Facet types.
Compare any Facet-derived type without requiring PartialEq - rediff uses reflection to compare values structurally and produce detailed, colorized diff output.
- Structural comparison without
PartialEq - Pretty
assert_same!andassert_sameish!macros for testing - Multi-format rendering (Rust, JSON, XML styles)
- ANSI colored terminal output
- Myers' algorithm for sequence diffing
cargo add rediffuse facet::Facet;
use rediff::assert_same;
#[derive(Facet)]
struct Point { x: i32, y: i32 }
let a = Point { x: 10, y: 20 };
let b = Point { x: 10, y: 20 };
assert_same!(a, b);use facet::Facet;
use rediff::{FacetDiff, format_diff_default};
#[derive(Facet)]
struct Config {
host: String,
port: u16,
}
let old = Config { host: "localhost".into(), port: 8080 };
let new = Config { host: "localhost".into(), port: 9000 };
let diff = old.diff(&new);
println!("{}", format_diff_default(&diff));