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

Method content_without_newline

atomic-core/src/diff/line.rs:227–233  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

225 /// ```
226 #[inline]
227 pub fn content_without_newline(&self) -> &'a [u8] {
228 if self.trailing_newline {
229 &self.content[..self.content.len() - 1]
230 } else {
231 self.content
232 }
233 }
234
235 /// Check if this line has a trailing newline.
236 #[inline]

Callers 2

equalsMethod · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected