Create a new line splitter. # Arguments `content` - The bytes to split into lines `separator` - The separator pattern to use # Example ```rust use atomic_core::diff::{LineSplit, Separator}; let content = b"line1\nline2\n"; let lines: Vec<_> = LineSplit::new(content, &Separator::Newline).collect(); assert_eq!(lines.len(), 2); ```
(content: &'a [u8], separator: &'a Separator)
| 183 | /// assert_eq!(lines.len(), 2); |
| 184 | /// ``` |
| 185 | pub fn new(content: &'a [u8], separator: &'a Separator) -> Self { |
| 186 | Self { |
| 187 | content, |
| 188 | separator, |
| 189 | position: 0, |
| 190 | finished: content.is_empty(), |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /// Create a line splitter using the default newline separator. |
| 195 | /// |