| 76 | /// See the module documentation for detailed comparison. |
| 77 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
| 78 | pub enum Algorithm { |
| 79 | /// Myers diff algorithm - finds the shortest edit script. |
| 80 | /// |
| 81 | /// This is the default algorithm, suitable for most use cases. |
| 82 | /// It guarantees finding the minimum number of changes but may |
| 83 | /// sometimes produce diffs that are harder to read when there |
| 84 | /// are many repeated lines. |
| 85 | Myers, |
| 86 | |
| 87 | /// Patience diff algorithm - uses unique lines as anchors. |
| 88 | /// |
| 89 | /// This algorithm often produces more human-readable diffs, |
| 90 | /// especially for code with repeated patterns. It may not |
| 91 | /// find the absolute minimum edit distance but typically |
| 92 | /// produces more intuitive results. |
| 93 | Patience, |
| 94 | } |
| 95 | |
| 96 | impl Default for Algorithm { |
| 97 | /// Returns the default algorithm (Myers). |
nothing calls this directly
no outgoing calls
no test coverage detected