Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ use uri;
/// functions in this crate, but all other errors can be converted to this
/// error. Consumers of this crate can typically consume and work with this form
/// of error for conversions with the `?` operator.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Error {
inner: ErrorKind,
}

/// A `Result` typedef to use with the `http::Error` type
pub type Result<T> = result::Result<T, Error>;

#[derive(Debug)]
#[derive(Clone, Debug)]
enum ErrorKind {
StatusCode(status::InvalidStatusCode),
Method(method::InvalidMethod),
Expand Down
4 changes: 2 additions & 2 deletions src/header/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ struct MaybeLower<'a> {
}

/// A possible error when converting a `HeaderName` from another type.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidHeaderName {
_priv: (),
}

/// A possible error when converting a `HeaderName` from another type.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidHeaderNameBytes(InvalidHeaderName) ;

macro_rules! standard_headers {
Expand Down
6 changes: 3 additions & 3 deletions src/header/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ pub struct HeaderValue {

/// A possible error when converting a `HeaderValue` from a string or byte
/// slice.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidHeaderValue {
_priv: (),
}

/// A possible error when converting a `HeaderValue` from a string or byte
/// slice.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidHeaderValueBytes(InvalidHeaderValue);

/// A possible error when converting a `HeaderValue` to a string representation.
///
/// Header field values may contain opaque bytes, in which case it is not
/// possible to represent the value as a string.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct ToStrError {
_priv: (),
}
Expand Down
2 changes: 1 addition & 1 deletion src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use std::error::Error;
pub struct Method(Inner);

/// A possible error value when converting `Method` from bytes.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidMethod {
_priv: (),
}
Expand Down
2 changes: 1 addition & 1 deletion src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct StatusCode(u16);
///
/// This error indicates that the supplied input was not a valid number, was less
/// than 100, or was greater than 599.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidStatusCode {
_priv: (),
}
Expand Down
8 changes: 4 additions & 4 deletions src/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ pub struct Parts {
}

/// An error resulting from a failed attempt to construct a URI.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidUri(ErrorKind);

/// An error resulting from a failed attempt to construct a URI.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidUriBytes(InvalidUri);

/// An error resulting from a failed attempt to construct a URI.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct InvalidUriParts(InvalidUri);

#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
enum ErrorKind {
InvalidUriChar,
InvalidScheme,
Expand Down