From c0c1817b5c9cbcdd4c74c1671dd20bdd3eda7486 Mon Sep 17 00:00:00 2001 From: axon-q Date: Thu, 7 Jun 2018 10:33:00 +0000 Subject: [PATCH] remove unicase dependency --- Cargo.toml | 1 - src/header/common/content_disposition.rs | 12 +++++------- src/lib.rs | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9d080f53b..9cd3304fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,6 @@ time = "0.1" encoding = "0.2" language-tags = "0.2" lazy_static = "1.0" -unicase = "2.1" url = { version="1.7", features=["query_encoding"] } cookie = { version="0.10", features=["percent-encode"] } brotli2 = { version="^0.3.2", optional = true } diff --git a/src/header/common/content_disposition.rs b/src/header/common/content_disposition.rs index b26644e58..b2563c0d9 100644 --- a/src/header/common/content_disposition.rs +++ b/src/header/common/content_disposition.rs @@ -7,8 +7,6 @@ // IANA assignment: http://www.iana.org/assignments/cont-disp/cont-disp.xhtml use language_tags::LanguageTag; -use unicase; - use header; use header::{Header, IntoHeaderValue, Writer}; use header::shared::Charset; @@ -100,9 +98,9 @@ impl ContentDisposition { }; let mut cd = ContentDisposition { - disposition: if unicase::eq_ascii(&*disposition, "inline") { + disposition: if disposition.eq_ignore_ascii_case("inline") { DispositionType::Inline - } else if unicase::eq_ascii(&*disposition, "attachment") { + } else if disposition.eq_ignore_ascii_case("attachment") { DispositionType::Attachment } else { DispositionType::Ext(disposition.to_owned()) @@ -126,11 +124,11 @@ impl ContentDisposition { }; cd.parameters.push( - if unicase::eq_ascii(&*key, "filename") { + if key.eq_ignore_ascii_case("filename") { DispositionParam::Filename( Charset::Ext("UTF-8".to_owned()), None, val.trim_matches('"').as_bytes().to_owned()) - } else if unicase::eq_ascii(&*key, "filename*") { + } else if key.eq_ignore_ascii_case("filename*") { let extended_value = try!(header::parse_extended_value(val)); DispositionParam::Filename(extended_value.charset, extended_value.language_tag, extended_value.value) } else { @@ -177,7 +175,7 @@ impl fmt::Display for ContentDisposition { let mut use_simple_format: bool = false; if opt_lang.is_none() { if let Charset::Ext(ref ext) = *charset { - if unicase::eq_ascii(&**ext, "utf-8") { + if ext.eq_ignore_ascii_case("utf-8") { use_simple_format = true; } } diff --git a/src/lib.rs b/src/lib.rs index 25b4ef776..5b1420305 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -118,7 +118,6 @@ extern crate tokio_io; extern crate tokio_reactor; extern crate tokio_tcp; extern crate tokio_timer; -extern crate unicase; extern crate url; #[macro_use] extern crate serde;