acorn-diff
Portable, deterministic unified-text and RFC 6902 JSON Patch primitives for ACORN and other Rust applications.
The default std feature supports native applications. Portable consumers can disable default features and enable the minimum allocation-backed API:
[]
= { = "0.3.2", = false, = ["alloc"] }
Create a labeled unified line diff:
use unified_diff;
let output = unified_diff;
assert!;
assert!;
assert!;
Create a deterministic JSON Patch from two serde_json::Value instances:
use DiffValue;
use json;
let patch = json!.diff;
let encoded = to_value.expect;
assert_eq!;
Generated patches use deterministic object-key ordering and the add, remove, and replace operation subset. The Rfc6902 trait exposes validated constructors for all six RFC 6902 operation shapes. ACORN-specific format detection and canonicalization remain in acorn::analyzer::diff.