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>,
)
| 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 | /// |