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:
@@ -1,7 +1,7 @@
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use header::{Header, HeaderFormat};
|
||||
use header::shared::util::{from_one_comma_delimited, fmt_comma_delimited};
|
||||
use header::parsing::{from_one_comma_delimited, fmt_comma_delimited};
|
||||
|
||||
/// The Cache-Control header.
|
||||
#[derive(PartialEq, Clone, Show)]
|
||||
@@ -163,4 +163,3 @@ mod tests {
|
||||
}
|
||||
|
||||
bench_header!(normal, CacheControl, { vec![b"no-cache, private".to_vec(), b"max-age=100".to_vec()] });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user