@@ -2,7 +2,7 @@ use std::fmt::{self, Display, Formatter};
22use std:: str:: { from_utf8, FromStr } ;
33use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
44
5- use http_types:: { bail, ensure, format_err, Error } ;
5+ use http_types:: { bail, ensure, format_err} ;
66
77const IMF_FIXDATE_LENGTH : usize = 29 ;
88const RFC850_MAX_LENGTH : usize = 23 ;
@@ -39,7 +39,7 @@ pub struct HttpDate {
3939/// ascdate formats. Two digit years are mapped to dates between
4040/// 1970 and 2069.
4141#[ allow( dead_code) ]
42- pub ( crate ) fn parse_http_date ( s : & str ) -> Result < SystemTime , Error > {
42+ pub ( crate ) fn parse_http_date ( s : & str ) -> http_types :: Result < SystemTime > {
4343 s. parse :: < HttpDate > ( ) . map ( |d| d. into ( ) )
4444}
4545
@@ -66,7 +66,7 @@ impl HttpDate {
6666 }
6767}
6868
69- fn parse_imf_fixdate ( s : & [ u8 ] ) -> Result < HttpDate , Error > {
69+ fn parse_imf_fixdate ( s : & [ u8 ] ) -> http_types :: Result < HttpDate > {
7070 // Example: `Sun, 06 Nov 1994 08:49:37 GMT`
7171 if s. len ( ) != IMF_FIXDATE_LENGTH
7272 || & s[ 25 ..] != b" GMT"
@@ -110,7 +110,7 @@ fn parse_imf_fixdate(s: &[u8]) -> Result<HttpDate, Error> {
110110 } )
111111}
112112
113- fn parse_rfc850_date ( s : & [ u8 ] ) -> Result < HttpDate , Error > {
113+ fn parse_rfc850_date ( s : & [ u8 ] ) -> http_types :: Result < HttpDate > {
114114 // Example: `Sunday, 06-Nov-94 08:49:37 GMT`
115115 ensure ! (
116116 s. len( ) >= RFC850_MAX_LENGTH ,
@@ -165,7 +165,7 @@ fn parse_rfc850_date(s: &[u8]) -> Result<HttpDate, Error> {
165165 } )
166166}
167167
168- fn parse_asctime ( s : & [ u8 ] ) -> Result < HttpDate , Error > {
168+ fn parse_asctime ( s : & [ u8 ] ) -> http_types :: Result < HttpDate > {
169169 // Example: `Sun Nov 6 08:49:37 1994`
170170 if s. len ( ) != ASCTIME_LENGTH || s[ 10 ] != b' ' || s[ 13 ] != b':' || s[ 16 ] != b':' || s[ 19 ] != b' '
171171 {
@@ -326,7 +326,7 @@ impl From<HttpDate> for SystemTime {
326326}
327327
328328impl FromStr for HttpDate {
329- type Err = Error ;
329+ type Err = http_types :: Error ;
330330
331331 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
332332 ensure ! ( s. is_ascii( ) , "String slice is not valid ASCII" ) ;
0 commit comments