File tree 3 files changed +16
-25
lines changed
3 files changed +16
-25
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,5 @@ impl Debug for BytesRef<'_> {
36
36
}
37
37
}
38
38
39
- impl Debug for Bytes {
40
- fn fmt ( & self , f : & mut Formatter < ' _ > ) -> Result {
41
- Debug :: fmt ( & BytesRef ( self . as_ref ( ) ) , f)
42
- }
43
- }
44
-
45
- impl Debug for BytesMut {
46
- fn fmt ( & self , f : & mut Formatter < ' _ > ) -> Result {
47
- Debug :: fmt ( & BytesRef ( self . as_ref ( ) ) , f)
48
- }
49
- }
39
+ fmt_impl ! ( Debug , Bytes ) ;
40
+ fmt_impl ! ( Debug , BytesMut ) ;
Original file line number Diff line number Diff line change @@ -21,17 +21,7 @@ impl UpperHex for BytesRef<'_> {
21
21
}
22
22
}
23
23
24
- macro_rules! hex_impl {
25
- ( $tr: ident, $ty: ty) => {
26
- impl $tr for $ty {
27
- fn fmt( & self , f: & mut Formatter <' _>) -> Result {
28
- $tr:: fmt( & BytesRef ( self . as_ref( ) ) , f)
29
- }
30
- }
31
- } ;
32
- }
33
-
34
- hex_impl ! ( LowerHex , Bytes ) ;
35
- hex_impl ! ( LowerHex , BytesMut ) ;
36
- hex_impl ! ( UpperHex , Bytes ) ;
37
- hex_impl ! ( UpperHex , BytesMut ) ;
24
+ fmt_impl ! ( LowerHex , Bytes ) ;
25
+ fmt_impl ! ( LowerHex , BytesMut ) ;
26
+ fmt_impl ! ( UpperHex , Bytes ) ;
27
+ fmt_impl ! ( UpperHex , BytesMut ) ;
Original file line number Diff line number Diff line change
1
+ macro_rules! fmt_impl {
2
+ ( $tr: ident, $ty: ty) => {
3
+ impl $tr for $ty {
4
+ fn fmt( & self , f: & mut Formatter <' _>) -> Result {
5
+ $tr:: fmt( & BytesRef ( self . as_ref( ) ) , f)
6
+ }
7
+ }
8
+ } ;
9
+ }
10
+
1
11
mod debug;
2
12
mod hex;
3
13
You can’t perform that action at this time.
0 commit comments