smol_bytes/bytes_mut/
fmt.rs1use super::*;
2
3impl core::fmt::Debug for BytesMut {
4 #[cfg_attr(not(coverage), inline(always))]
5 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6 match &self.0 {
7 Repr::Inline(b) => b.fmt(f),
8 Repr::Heap(b) => b.fmt(f),
9 }
10 }
11}
12
13impl core::fmt::LowerHex for BytesMut {
14 #[cfg_attr(not(coverage), inline(always))]
15 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
16 match &self.0 {
17 Repr::Inline(b) => b.fmt(f),
18 Repr::Heap(b) => b.fmt(f),
19 }
20 }
21}
22
23impl core::fmt::UpperHex for BytesMut {
24 #[cfg_attr(not(coverage), inline(always))]
25 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
26 match &self.0 {
27 Repr::Inline(b) => b.fmt(f),
28 Repr::Heap(b) => b.fmt(f),
29 }
30 }
31}
32
33impl core::fmt::Write for BytesMut {
34 #[cfg_attr(not(coverage), inline(always))]
35 fn write_str(&mut self, s: &str) -> core::fmt::Result {
36 self.extend_from_slice(s.as_bytes());
37 Ok(())
38 }
39}