refactor(error): remove redundant parts of error names
The old names followed the old style of including the module name and "Error" in each variant. The new style is to refer to an error from its owning module, and variants are now scoped to their enum, so there's no need to include the enum name in the variant name. BREAKING CHANGE: The terms `Http` and `Error` have been removed from the Error type and its variants. `HttpError` should now be accessed as `hyper::Error`, and variants like `HttpIoError` should be accessed as `Error::Io`.
This commit is contained in:
		| @@ -3,7 +3,7 @@ use std::str::FromStr; | ||||
| use url::Url; | ||||
| use url::ParseError as UrlError; | ||||
|  | ||||
| use error::HttpError; | ||||
| use Error; | ||||
|  | ||||
| /// The Request-URI of a Request's StartLine. | ||||
| /// | ||||
| @@ -50,12 +50,12 @@ pub enum RequestUri { | ||||
| } | ||||
|  | ||||
| impl FromStr for RequestUri { | ||||
|     type Err = HttpError; | ||||
|     type Err = Error; | ||||
|  | ||||
|     fn from_str(s: &str) -> Result<RequestUri, HttpError> { | ||||
|     fn from_str(s: &str) -> Result<RequestUri, Error> { | ||||
|         let bytes = s.as_bytes(); | ||||
|         if bytes == [] { | ||||
|             Err(HttpError::HttpUriError(UrlError::InvalidCharacter)) | ||||
|             Err(Error::Uri(UrlError::InvalidCharacter)) | ||||
|         } else if bytes == b"*" { | ||||
|             Ok(RequestUri::Star) | ||||
|         } else if bytes.starts_with(b"/") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user