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:
@@ -13,8 +13,8 @@ pub use net::{Fresh, Streaming};
|
||||
|
||||
use HttpError::HttpIoError;
|
||||
use {HttpResult};
|
||||
use header::common::Connection;
|
||||
use header::common::connection::{KeepAlive, Close};
|
||||
use header::Connection;
|
||||
use header::ConnectionOption::{Close, KeepAlive};
|
||||
use net::{NetworkListener, NetworkStream, NetworkAcceptor,
|
||||
HttpAcceptor, HttpListener};
|
||||
use version::HttpVersion::{Http10, Http11};
|
||||
@@ -183,4 +183,3 @@ impl<F> Handler for F where F: Fn(Request, Response<Fresh>), F: Sync + Send {
|
||||
(*self)(req, res)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user