feat(http): use the bytes crate for Chunk and internally

This commit is contained in:
Sean McArthur
2017-03-01 14:14:34 -08:00
parent cf7cc50ad0
commit 65b3e08f69
14 changed files with 306 additions and 598 deletions

View File

@@ -87,7 +87,7 @@ use self::internals::{Item, VecMap, Entry};
pub use self::shared::*;
pub use self::common::*;
pub use self::raw::Raw;
use http::buf::MemSlice;
use bytes::Bytes;
mod common;
mod internals;
@@ -611,8 +611,8 @@ impl<'a> Extend<HeaderView<'a>> for Headers {
}
}
impl<'a> Extend<(&'a str, MemSlice)> for Headers {
fn extend<I: IntoIterator<Item=(&'a str, MemSlice)>>(&mut self, iter: I) {
impl<'a> Extend<(&'a str, Bytes)> for Headers {
fn extend<I: IntoIterator<Item=(&'a str, Bytes)>>(&mut self, iter: I) {
for (name, value) in iter {
let name = HeaderName(UniCase(maybe_literal(name)));
//let trim = header.value.iter().rev().take_while(|&&x| x == b' ').count();