File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ pub enum Error {
26
26
Io ( io:: Error ) ,
27
27
}
28
28
29
- impl error :: FromError < io:: Error > for Error {
30
- fn from_error ( err : io:: Error ) -> Error { Error :: Io ( err) }
29
+ impl From < io:: Error > for Error {
30
+ fn from ( err : io:: Error ) -> Error { Error :: Io ( err) }
31
31
}
32
32
33
- impl error :: FromError < Error > for io:: Error {
34
- fn from_error ( err : Error ) -> io:: Error {
33
+ impl From < Error > for io:: Error {
34
+ fn from ( err : Error ) -> io:: Error {
35
35
match err {
36
36
Error :: Io ( err) => err,
37
37
Error :: UnexpectedEOF => io:: Error :: new ( io:: ErrorKind :: Other ,
@@ -188,14 +188,14 @@ fn read_full<R: io::Read + ?Sized>(rdr: &mut R, buf: &mut [u8]) -> Result<()> {
188
188
Ok ( 0 ) => return Err ( Error :: UnexpectedEOF ) ,
189
189
Ok ( n) => nread += n,
190
190
Err ( ref e) if e. kind ( ) == io:: ErrorKind :: Interrupted => { } ,
191
- Err ( e) => return Err ( error :: FromError :: from_error ( e) )
191
+ Err ( e) => return Err ( From :: from ( e) )
192
192
}
193
193
}
194
194
Ok ( ( ) )
195
195
}
196
196
197
197
fn write_all < W : io:: Write + ?Sized > ( wtr : & mut W , buf : & [ u8 ] ) -> Result < ( ) > {
198
- wtr. write_all ( buf) . map_err ( error :: FromError :: from_error )
198
+ wtr. write_all ( buf) . map_err ( From :: from )
199
199
}
200
200
201
201
/// Extends `Write` with methods for writing numbers. (For `std::io`.)
You can’t perform that action at this time.
0 commit comments