1
1
use crate :: ByteSlice ;
2
- use nom:: { lib:: std:: fmt:: Formatter , lib:: std:: ops:: Deref } ;
3
2
use quick_error:: quick_error;
3
+ use std:: ops:: Deref ;
4
+ use std:: { fmt, io} ;
4
5
5
6
#[ derive( PartialEq , Eq , Debug , Hash , Ord , PartialOrd , Clone , Copy ) ]
6
7
#[ cfg_attr( feature = "serde1" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
@@ -20,6 +21,12 @@ pub struct Time {
20
21
pub sign : Sign ,
21
22
}
22
23
24
+ impl Time {
25
+ pub fn write_to ( & self , out : impl io:: Write ) -> io:: Result < ( ) > {
26
+ unimplemented ! ( "time write to" )
27
+ }
28
+ }
29
+
23
30
pub const SHA1_SIZE : usize = 20 ;
24
31
25
32
/// A SHA1 identifying objects
@@ -60,8 +67,8 @@ impl Deref for Id {
60
67
}
61
68
}
62
69
63
- impl std :: fmt:: Display for Id {
64
- fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std :: fmt:: Result {
70
+ impl fmt:: Display for Id {
71
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt:: Result {
65
72
let mut buf = [ 0u8 ; 40 ] ;
66
73
self . encode_to_40_bytes_slice ( & mut buf) . unwrap ( ) ;
67
74
write ! ( f, "{}" , & buf. as_bstr( ) )
@@ -106,8 +113,8 @@ impl Kind {
106
113
}
107
114
}
108
115
109
- impl std :: fmt:: Display for Kind {
110
- fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std :: fmt:: Result {
116
+ impl fmt:: Display for Kind {
117
+ fn fmt ( & self , f : & mut fmt :: Formatter < ' _ > ) -> fmt:: Result {
111
118
f. write_str ( std:: str:: from_utf8 ( self . to_bytes ( ) ) . expect ( "valid utf8 in kind name" ) )
112
119
}
113
120
}
0 commit comments