refactor(lib): update unicase to 2.0

BREAKING CHANGE: Some headers used `UniCase`, but now use
  `unicase::Ascii`. Upgrade code to `Ascii::new(s)`.
This commit is contained in:
Sean McArthur
2017-02-01 15:14:18 -08:00
parent fed04dfb58
commit c81edd41d7
12 changed files with 69 additions and 72 deletions

View File

@@ -1,4 +1,4 @@
use unicase::UniCase;
use unicase::Ascii;
header! {
/// `Vary` header, defined in [RFC7231](https://tools.ietf.org/html/rfc7231#section-7.1.4)
@@ -34,18 +34,18 @@ header! {
/// // extern crate unicase;
///
/// use hyper::header::{Headers, Vary};
/// use unicase::UniCase;
/// use unicase::Ascii;
///
/// let mut headers = Headers::new();
/// headers.set(
/// Vary::Items(vec![
/// UniCase("accept-encoding".to_owned()),
/// UniCase("accept-language".to_owned()),
/// Ascii::new("accept-encoding".to_owned()),
/// Ascii::new("accept-language".to_owned()),
/// ])
/// );
/// # }
/// ```
(Vary, "Vary") => {Any / (UniCase<String>)+}
(Vary, "Vary") => {Any / (Ascii<String>)+}
test_vary {
test_header!(test1, vec![b"accept-encoding, accept-language"]);