| Crates.io | deep-diff |
| lib.rs | deep-diff |
| version | 0.1.1 |
| created_at | 2025-09-06 12:23:19.241726+00 |
| updated_at | 2025-09-06 12:30:48.759533+00 |
| description | A small crate to deeply diff serde_json::Value trees. |
| homepage | |
| repository | https://github.com/thePaulBurger/deep-diff |
| max_upload_size | |
| id | 1827013 |
| size | 12,449 |
A small Rust crate to deeply diff serde_json::Value trees.
This crate helps you compare two JSON values recursively and returns a list of differences, showing exactly which parts have changed.
Add this to your Cargo.toml:
[dependencies]
deep-diff = "0.1"
serde_json = "1.0"
use deep_diff::{deep_diff, Difference};
use serde_json::json;
fn main() {
let a = json!({"name": "Alice", "age": 30});
let b = json!({"name": "Bob", "age": 30});
let diffs = deep_diff(&a, &b);
for diff in diffs {
println!("Changed at path '{}': from {:?} to {:?}", diff.path, diff.before, diff.after);
}
}