refactor(lib): clean up unused dependencies
This commit is contained in:
@@ -21,7 +21,6 @@ include = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
base64 = "0.9"
|
||||
bytes = "0.4.4"
|
||||
futures = "0.1.17"
|
||||
futures-cpupool = "0.1.6"
|
||||
@@ -29,18 +28,13 @@ futures-timer = "0.1.0"
|
||||
http = "0.1.5"
|
||||
httparse = "1.0"
|
||||
iovec = "0.1"
|
||||
language-tags = "0.2"
|
||||
log = "0.4"
|
||||
mime = "0.3.2"
|
||||
net2 = "0.2.32"
|
||||
percent-encoding = "1.0"
|
||||
relay = "0.1"
|
||||
time = "0.1"
|
||||
tokio = "0.1.3"
|
||||
tokio-executor = "0.1.0"
|
||||
tokio-service = "0.1"
|
||||
tokio-io = "0.1"
|
||||
unicase = "2.0"
|
||||
|
||||
[dev-dependencies]
|
||||
num_cpus = "1.0"
|
||||
|
||||
@@ -4,7 +4,6 @@ use bytes::BytesMut;
|
||||
use http::HeaderMap;
|
||||
use http::header::{CONNECTION, CONTENT_LENGTH, EXPECT, TRANSFER_ENCODING};
|
||||
use http::header::{HeaderValue, OccupiedEntry, ValueIter};
|
||||
use unicase;
|
||||
|
||||
/// Maximum number of bytes needed to serialize a u64 into ASCII decimal.
|
||||
const MAX_DECIMAL_U64_BYTES: usize = 20;
|
||||
@@ -13,7 +12,7 @@ pub fn connection_keep_alive(headers: &HeaderMap) -> bool {
|
||||
for line in headers.get_all(CONNECTION) {
|
||||
if let Ok(s) = line.to_str() {
|
||||
for val in s.split(',') {
|
||||
if unicase::eq_ascii(val.trim(), "keep-alive") {
|
||||
if eq_ascii(val.trim(), "keep-alive") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +26,7 @@ pub fn connection_close(headers: &HeaderMap) -> bool {
|
||||
for line in headers.get_all(CONNECTION) {
|
||||
if let Ok(s) = line.to_str() {
|
||||
for val in s.split(',') {
|
||||
if unicase::eq_ascii(val.trim(), "close") {
|
||||
if eq_ascii(val.trim(), "close") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +97,7 @@ pub fn is_chunked(mut encodings: ValueIter<HeaderValue>) -> bool {
|
||||
if let Some(line) = encodings.next_back() {
|
||||
if let Ok(s) = line.to_str() {
|
||||
if let Some(encoding) = s.rsplit(',').next() {
|
||||
return unicase::eq_ascii(encoding.trim(), "chunked");
|
||||
return eq_ascii(encoding.trim(), "chunked");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +124,17 @@ pub fn add_chunked(mut entry: OccupiedEntry<HeaderValue>) {
|
||||
entry.insert(HeaderValue::from_static(CHUNKED));
|
||||
}
|
||||
|
||||
fn eq_ascii(left: &str, right: &str) -> bool {
|
||||
// As of Rust 1.23, str gained this method inherently, and so the
|
||||
// compiler says this trait is unused.
|
||||
//
|
||||
// Once our minimum Rust compiler version is >=1.23, this can be removed.
|
||||
#[allow(unused)]
|
||||
use std::ascii::AsciiExt;
|
||||
|
||||
left.eq_ignore_ascii_case(right)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
|
||||
@@ -25,13 +25,11 @@ extern crate httparse;
|
||||
extern crate iovec;
|
||||
#[macro_use] extern crate log;
|
||||
extern crate net2;
|
||||
extern crate relay;
|
||||
extern crate time;
|
||||
extern crate tokio;
|
||||
extern crate tokio_executor;
|
||||
#[macro_use] extern crate tokio_io;
|
||||
extern crate tokio_service;
|
||||
extern crate unicase;
|
||||
|
||||
#[cfg(all(test, feature = "nightly"))]
|
||||
extern crate test;
|
||||
|
||||
Reference in New Issue
Block a user