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

Method from_result

atomic-core/src/diff/display.rs:265–279  ·  view source on GitHub ↗

Create a unified diff from pre-computed diff result. This is useful when you've already computed the diff and want to display it without re-computing.

(
        old: &'a [u8],
        new: &'a [u8],
        old_lines: Vec<Line<'a>>,
        new_lines: Vec<Line<'a>>,
        diff_result: DiffResult,
    )

Source from the content-addressed store, hash-verified

263 /// This is useful when you've already computed the diff and want
264 /// to display it without re-computing.
265 pub fn from_result(
266 old: &'a [u8],
267 new: &'a [u8],
268 old_lines: Vec<Line<'a>>,
269 new_lines: Vec<Line<'a>>,
270 diff_result: DiffResult,
271 ) -> Self {
272 Self {
273 old_content: old,
274 new_content: new,
275 diff_result,
276 old_lines,
277 new_lines,
278 }
279 }
280
281 /// Get the underlying diff result.
282 pub fn diff_result(&self) -> &DiffResult {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected