MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / new

Method new

atomic-core/src/diff/split.rs:185–192  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected