3 unstable releases
Uses new Rust 2024
| 1.0.0 |
|
|---|---|
| 0.46.1 | May 7, 2026 |
| 0.46.0 | May 5, 2026 |
| 0.44.0 | Mar 1, 2026 |
#130 in Testing
29 downloads per month
Used in 2 crates
300KB
6K
SLoC
rediff
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.
Features
- 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
Installation
cargo add rediff
Usage
Assertions in tests
use 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);
Diffing values
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));
Dependencies
~10–15MB
~249K SLoC