MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / sample_file_diff

Function sample_file_diff

atomic-cli/src/commands/diff/json.rs:236–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234 use super::*;
235
236 fn sample_file_diff() -> FileDiff {
237 let mut diff = FileDiff::modified("src/main.rs");
238 let mut hunk = DiffHunk::new(1, 2, 1, 2);
239 hunk.add_line(HunkLine::context("fn main() {", 1, 1));
240 hunk.add_line(HunkLine::removed(" println!(\"hi\");", 2));
241 hunk.add_line(HunkLine::added(" println!(\"hi, world\");", 2));
242 diff.add_hunk(hunk);
243 diff.stats = FileDiffStats::modified("src/main.rs", 1, 1);
244 diff
245 }
246
247 fn sample_stats(files: &[FileDiff]) -> DiffStats {
248 let mut stats = DiffStats::new();

Callers

nothing calls this directly

Calls 6

modifiedFunction · 0.85
contextFunction · 0.85
removedFunction · 0.85
addedFunction · 0.85
add_lineMethod · 0.45
add_hunkMethod · 0.45

Tested by

no test coverage detected