Add Error impls to a few key error types
This commit is contained in:
@@ -222,7 +222,9 @@ responding to errors that may occur while attempting to read the numbers.
|
||||
#![deny(unused_must_use)]
|
||||
|
||||
use char::Char;
|
||||
use clone::Clone;
|
||||
use default::Default;
|
||||
use error::{FromError, Error};
|
||||
use fmt;
|
||||
use int;
|
||||
use iter::Iterator;
|
||||
@@ -433,6 +435,22 @@ impl fmt::Show for IoError {
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for IoError {
|
||||
fn description(&self) -> &str {
|
||||
self.desc
|
||||
}
|
||||
|
||||
fn detail(&self) -> Option<String> {
|
||||
self.detail.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl FromError<IoError> for Box<Error> {
|
||||
fn from_error(err: IoError) -> Box<Error> {
|
||||
box err
|
||||
}
|
||||
}
|
||||
|
||||
/// A list specifying general categories of I/O error.
|
||||
#[deriving(PartialEq, Eq, Clone, Show)]
|
||||
pub enum IoErrorKind {
|
||||
|
||||
Reference in New Issue
Block a user