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:
		| @@ -8,8 +8,7 @@ use std::io::net::ip::SocketAddr; | ||||
| use {HttpResult}; | ||||
| use version::{HttpVersion}; | ||||
| use method::Method::{self, Get, Head}; | ||||
| use header::Headers; | ||||
| use header::common::{ContentLength, TransferEncoding}; | ||||
| use header::{Headers, ContentLength, TransferEncoding}; | ||||
| use http::{read_request_line}; | ||||
| use http::HttpReader; | ||||
| use http::HttpReader::{SizedReader, ChunkedReader, EmptyReader}; | ||||
| @@ -74,8 +73,7 @@ impl<'a> Reader for Request<'a> { | ||||
|  | ||||
| #[cfg(test)] | ||||
| mod tests { | ||||
|     use header::common::{Host, TransferEncoding}; | ||||
|     use header::common::transfer_encoding::Encoding; | ||||
|     use header::{Host, TransferEncoding, Encoding}; | ||||
|     use mock::MockStream; | ||||
|     use super::Request; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user