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

Method from_text

atomic-core/src/diff/line.rs:202–204  ·  view source on GitHub ↗

Split a string into lines. Convenience wrapper around [`from_bytes`](Self::from_bytes) for string input. # Example ```rust use atomic_core::diff::Line; let lines = Line::from_text("hello\nworld\n"); assert_eq!(lines.len(), 2); ```

(text: &'a str)

Source from the content-addressed store, hash-verified

200 /// assert_eq!(lines.len(), 2);
201 /// ```
202 pub fn from_text(text: &'a str) -> Vec<Self> {
203 Self::from_bytes(text.as_bytes())
204 }
205
206 /// Get the raw content of this line.
207 ///

Callers

nothing calls this directly

Calls 1

as_bytesMethod · 0.45

Tested by

no test coverage detected