refactor(headers): export all headers and utils directly under header
Currently headers are exported at many places. For example you can access `Transfer-Encoding` header at `header`, `header::common` and `header::common::transfer_encoding`. Per discussion on IRC with @seanmonstar and @reem, all contents of headers will be exposed at `header` directly. Parsing utilities will be exposed at `header::parsing`. Header macros can now be used from other crates. This breaks much code using headers. It should use everything it needs directly from `header::`, encodings are exposed at `header::Encoding::`, connection options are exposed at `header::ConnectionOption`.
This commit is contained in:
		| @@ -23,13 +23,12 @@ use unicase::UniCase; | ||||
|  | ||||
| use {http, HttpResult}; | ||||
|  | ||||
| pub use self::shared::{Encoding, QualityItem, qitem}; | ||||
| pub use self::common::*; | ||||
| pub use self::shared::*; | ||||
|  | ||||
| /// Common Headers | ||||
| pub mod common; | ||||
|  | ||||
| pub mod shared; | ||||
| mod common; | ||||
| mod shared; | ||||
| pub mod parsing; | ||||
|  | ||||
| type HeaderName = UniCase<CowString<'static>>; | ||||
|  | ||||
| @@ -237,7 +236,7 @@ impl Headers { | ||||
|     /// | ||||
|     /// ``` | ||||
|     /// # use hyper::header::Headers; | ||||
|     /// # use hyper::header::common::ContentType; | ||||
|     /// # use hyper::header::ContentType; | ||||
|     /// # let mut headers = Headers::new(); | ||||
|     /// let has_type = headers.has::<ContentType>(); | ||||
|     /// ``` | ||||
| @@ -515,9 +514,8 @@ mod tests { | ||||
|     use mime::TopLevel::Text; | ||||
|     use mime::SubLevel::Plain; | ||||
|     use unicase::UniCase; | ||||
|     use super::{Headers, Header, HeaderFormat}; | ||||
|     use super::common::{ContentLength, ContentType, Accept, Host}; | ||||
|     use super::shared::{QualityItem}; | ||||
|     use super::{Headers, Header, HeaderFormat, ContentLength, ContentType, | ||||
|                 Accept, Host, QualityItem}; | ||||
|  | ||||
|     use test::Bencher; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user