Skip to content

Commit

Permalink
Replace FromError with From
Browse files Browse the repository at this point in the history
As per rust-lang/rust#23879.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Apr 2, 2015
1 parent 2374ac2 commit 91975ca
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/image.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::error::FromError;
use std::fmt;
use std::mem;
use std::io;
Expand Down Expand Up @@ -58,14 +57,14 @@ impl fmt::Display for ImageError {
}
}

impl FromError<io::Error> for ImageError {
fn from_error(err: io::Error) -> ImageError {
impl From<io::Error> for ImageError {
fn from(err: io::Error) -> ImageError {
ImageError::IoError(err)
}
}

impl FromError<byteorder::Error> for ImageError {
fn from_error(err: byteorder::Error) -> ImageError {
impl From<byteorder::Error> for ImageError {
fn from(err: byteorder::Error) -> ImageError {
match err {
byteorder::Error::UnexpectedEOF => ImageError::ImageEnd,
byteorder::Error::Io(err) => ImageError::IoError(err),
Expand Down

0 comments on commit 91975ca

Please sign in to comment.