cool_diff/render/mod.rs
1/// YAML-style diff renderer.
2pub mod yaml;
3
4use crate::model::DiffTree;
5
6/// Renders a `DiffTree` into a human-readable string.
7pub trait DiffRenderer {
8 /// Renders the diff tree as a string.
9 fn render(&self, tree: &DiffTree) -> String;
10}
11
12/// Line prefix characters for diff output.
13pub mod indicator {
14 /// Context lines (unchanged values, comments, structural markers).
15 pub const CONTEXT: char = ' ';
16
17 /// Expected values (what we wanted but didn't get).
18 pub const EXPECTED: char = '-';
19
20 /// Actual values (what we got instead).
21 pub const ACTUAL: char = '+';
22}