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,
)
| 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 { |
nothing calls this directly
no outgoing calls
no test coverage detected