MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / fmt

Method fmt

core/src/bytes.rs:96–104  ·  view source on GitHub ↗
(&self, f: &mut std::fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

94
95impl Display for Bytes {
96 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
97 // Display bytes as utf-8 if possible otherwise as hex
98 write!(
99 f,
100 "{}",
101 String::from_utf8(self.0.clone())
102 .unwrap_or_else(|_| format!("0x{}", hex::encode_upper(&self.0)))
103 )
104 }
105}
106
107impl Debug for Bytes {

Callers

nothing calls this directly

Calls 2

finishMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected