1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! # loom-diff
//!
//! Line-level diff used by both the loom CLI and the loom-gateway.
//! Pure functions: feed in two text blobs (or byte slices), get back
//! either a structured [`FileDiff`] (good for JSON / UI consumers) or
//! a `String` of git-style unified diff (good for terminal output).
//!
//! Backed by the `similar` crate's Myers algorithm. Binary blobs are
//! detected via a simple null-byte heuristic and surface as a `Binary`
//! diff variant — we don't try to render diffs of binary content.
//!
//! ## Layering
//!
//! ```text
//! loom-web · loom-gateway ← consumers
//! loom-diff ← THIS CRATE
//! ─── frozen below ─────────────────────────
//! weave-sdk · Strand · Locus · Lens · DHT · Forum
//! ```
pub use ;
pub use ;
use Error;
/// Errors produced by loom-diff.
/// Result alias.
pub type Result<T> = Result;
/// Heuristic: a byte slice is "probably binary" if the first 8KB
/// contains a null byte. This is the same check git uses.