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

Method display_content

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

Get a display-friendly representation of the content. For binary content, returns a placeholder like `[binary data: 42 bytes]`.

(&self)

Source from the content-addressed store, hash-verified

183 ///
184 /// For binary content, returns a placeholder like `[binary data: 42 bytes]`.
185 pub fn display_content(&self) -> std::borrow::Cow<'a, str> {
186 if self.is_binary() {
187 std::borrow::Cow::Owned(format!("[binary data: {} bytes]", self.raw.len()))
188 } else {
189 std::borrow::Cow::Borrowed(self.content)
190 }
191 }
192}
193
194impl<'a> fmt::Display for DisplayLine<'a> {

Callers

nothing calls this directly

Calls 1

is_binaryMethod · 0.45

Tested by

no test coverage detected