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

Method as_bytes

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

Get the separator as a byte slice.

(&self)

Source from the content-addressed store, hash-verified

83
84 /// Get the separator as a byte slice.
85 pub fn as_bytes(&self) -> &[u8] {
86 match self {
87 Separator::Newline => b"\n",
88 Separator::CrLf => b"\r\n",
89 Separator::Byte(b) => std::slice::from_ref(b),
90 Separator::Custom(v) => v.as_slice(),
91 }
92 }
93
94 /// Get the length of the separator in bytes.
95 pub fn len(&self) -> usize {

Callers 5

linesFunction · 0.45
word_diff_strFunction · 0.45
from_textMethod · 0.45
linesFunction · 0.45

Calls 1

as_sliceMethod · 0.45

Tested by 1