Skip to content

Commit 755a22d

Browse files
author
robo9k
committed
Replace FromError with From
1 parent f2c0182 commit 755a22d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/error.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
33
use std::fmt;
44
use std::io;
5-
use std::error::{Error, FromError};
5+
use std::error::Error;
6+
use std::convert::From;
67

78
/// `Error` variants for public errors in this crate
89
#[derive(Debug)]
@@ -32,8 +33,8 @@ impl Error for Chip8Error {
3233
}
3334
}
3435

35-
impl FromError<io::Error> for Chip8Error {
36-
fn from_error(err: io::Error) -> Chip8Error {
37-
Chip8Error::Io("Internal IO error: ", Some(err))
36+
impl From<io::Error> for Chip8Error {
37+
fn from(err: io::Error) -> Chip8Error {
38+
Chip8Error::Io("I/O error", Some(err))
3839
}
3940
}

0 commit comments

Comments
 (0)