fn from_iter<'x, I>(pairs: I) -> Key
        where I :Iterator<Item=(&'x str, &'x str)>+ExactSizeIterator
    {
        if pairs.len() == 0 {
            return Key(None);
        }
        let mut e = Encoder::new(Vec::new());
        e.object(pairs.len()).unwrap();
        for (k, v) in pairs {
            e.text(&k).unwrap();
            // TODO(tailhook) optimize numbers
            e.text(&v).unwrap();
        }
        Key(Some(e.into_writer().into()))
    }
/// Note: caller must ensure that order is Okay
caller must ensure that order is Okay
caller must ensure that order is Okay
fn from_iter<'x, I>(pairs: I) -> Key
        where I :Iterator<Item=(&'x str, &'x str)>+ExactSizeIterator
    {
        if pairs.len() == 0 {
            return Key(None);
        }
        let mut e = Encoder::new(Vec::new());
        e.object(pairs.len()).unwrap();
        for (k, v) in pairs {
            e.text(&k).unwrap();
            // TODO(tailhook) optimize numbers
            e.text(&v).unwrap();
        }
        Key(Some(e.into_writer().into()))
    }
fn from_iter < ' x , I > ( pairs : I ) -> Key where I : Iterator < Item = ( & ' x str , & ' x str ) > + ExactSizeIterator { if pairs . len ( ) == 0 { return Key ( None ) ; } let mut e = Encoder :: new ( Vec :: new ( ) ) ; e . object ( pairs . len ( ) ) . unwrap ( ) ; for ( k , v ) in pairs { e . text ( & k ) . unwrap ( ) ; // TODO(tailhook) optimize numbers e . text ( & v ) . unwrap ( ) ; } Key ( Some ( e . into_writer ( ) . into ( ) ) ) }
Note: caller must ensure that order is Okay
Note : caller must ensure that order is Okay
pairs
I
pairs
I