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

Method extract

atomic-core/src/diff/inline.rs:284–286  ·  view source on GitHub ↗

Extract the content of this hunk from a byte slice. # Panics Panics if the hunk range is out of bounds for the slice.

(&self, content: &'a [u8])

Source from the content-addressed store, hash-verified

282 ///
283 /// Panics if the hunk range is out of bounds for the slice.
284 pub fn extract<'a>(&self, content: &'a [u8]) -> &'a [u8] {
285 &content[self.start..self.end]
286 }
287
288 /// Safely extract the content, returning None if out of bounds.
289 pub fn try_extract<'a>(&self, content: &'a [u8]) -> Option<&'a [u8]> {

Callers 3

runMethod · 0.45
render_with_ansiMethod · 0.45
render_with_htmlMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected