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

Method with_diff

atomic-core/src/record/workflow/compare.rs:166–179  ·  view source on GitHub ↗

Create a result with diff operations. # Arguments `old_encoding` - Encoding of pristine content `new_encoding` - Encoding of working content `diff_ops` - The diff operations

(
        old_encoding: Encoding,
        new_encoding: Encoding,
        diff_ops: Vec<DiffOp>,
    )

Source from the content-addressed store, hash-verified

164 /// * `new_encoding` - Encoding of working content
165 /// * `diff_ops` - The diff operations
166 pub fn with_diff(
167 old_encoding: Encoding,
168 new_encoding: Encoding,
169 diff_ops: Vec<DiffOp>,
170 ) -> Self {
171 let content_changed = !diff_ops.is_empty();
172 Self {
173 old_encoding,
174 new_encoding,
175 content_changed,
176 diff_ops,
177 is_binary: false,
178 }
179 }
180
181 /// Check if the content has any changes.
182 ///

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected