Compare two lines for equality, optionally ignoring trailing newline differences. When `strict` is true, lines must match exactly including trailing newlines. When `strict` is false, a line ending in newline can match one without (useful for comparing last lines of files). # Arguments `other` - The line to compare with `strict` - Whether to require exact match including newlines # Example ```
(&self, other: &Self, strict: bool)
| 309 | /// assert!(line1.equals(&line2, false)); // Lenient: same content |
| 310 | /// ``` |
| 311 | pub fn equals(&self, other: &Self, strict: bool) -> bool { |
| 312 | if strict { |
| 313 | self.content == other.content |
| 314 | } else { |
| 315 | self.content_without_newline() == other.content_without_newline() |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | impl<'a> PartialEq for Line<'a> { |
nothing calls this directly
no test coverage detected