fix(rustup): update to newest fmt trait names and slice syntax

This commit is contained in:
Sean McArthur
2015-01-23 14:17:19 -08:00
parent bb4f913ede
commit 9e3c94d764
38 changed files with 90 additions and 114 deletions

View File

@@ -145,6 +145,7 @@ pub use status::StatusCode::{Ok, BadRequest, NotFound};
pub use server::Server;
use std::error::{Error, FromError};
use std::fmt;
use std::io::IoError;
use self::HttpError::{HttpMethodError, HttpUriError, HttpVersionError,
@@ -189,7 +190,7 @@ mod mimewrapper {
pub type HttpResult<T> = Result<T, HttpError>;
/// A set of errors that can occur parsing HTTP streams.
#[derive(Show, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone)]
pub enum HttpError {
/// An invalid `Method`, such as `GE,T`.
HttpMethodError,
@@ -205,6 +206,12 @@ pub enum HttpError {
HttpIoError(IoError),
}
impl fmt::Display for HttpError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.description())
}
}
impl Error for HttpError {
fn description(&self) -> &str {
match *self {