Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
Source from the content-addressed store, hash-verified
| 94 | |
| 95 | impl 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 | |
| 107 | impl Debug for Bytes { |
Callers
nothing calls this directly
Tested by
no test coverage detected