add vary header, first draft

This commit is contained in:
Rohan Prinja
2014-12-12 15:34:43 +05:30
parent 5e560cb1c1
commit 258e739ef8
3 changed files with 72 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ use std::borrow::Cow::{Borrowed, Owned};
use std::fmt::{mod, Show};
use std::intrinsics::TypeId;
use std::raw::TraitObject;
use std::str::SendStr;
use std::str::{SendStr, FromStr};
use std::collections::HashMap;
use std::collections::hash_map::{Entries, Occupied, Vacant};
use std::{hash, mem};
@@ -446,8 +446,15 @@ impl fmt::Show for Box<HeaderFormat + Send + Sync> {
}
}
/// Case-insensitive string.
//#[deriving(Clone)]
struct CaseInsensitive(SendStr);
pub struct CaseInsensitive(SendStr);
impl FromStr for CaseInsensitive {
fn from_str(s: &str) -> Option<CaseInsensitive> {
Some(CaseInsensitive(Owned(s.to_string())))
}
}
impl Clone for CaseInsensitive {
fn clone(&self) -> CaseInsensitive {