fn parse_tags(msg: &'a str) -> Result<(Option<Tags<'a>>, usize)> {
        let mut map = Tags::default();

        if let Some(idx) = msg.find(" :") {
            let tag = &msg[..idx];
            let toks = tag.split(';');

            for tok in toks {
                let items = tok.split('=').collect::<Vec<_>>();
                let key = items[0];
                let val = items[1];

                map.insert(key, TagValue::new(val));
            }

            Ok((Some(map), idx + 3))
        } else {
            Err(Error::new(ErrorKind::Other, "Parsing message tags failed."))
        }
    }
/// Helper function for parsing message tags.
Helper function for parsing message tags.
Helper function for parsing message tags .
fn parse_tags(msg: &'a str) -> Result<(Option<Tags<'a>>, usize)> {
        let mut map = Tags::default();
        if let Some(idx) = msg.find(" :") {
            let tag = &msg[..idx];
            let toks = tag.split(';');
            for tok in toks {
                let items = tok.split('=').collect::<Vec<_>>();
                let key = items[0];
                let val = items[1];
                map.insert(key, TagValue::new(val));
            }
            Ok((Some(map), idx + 3))
        } else {
            Err(Error::new(ErrorKind::Other, "Parsing message tags failed."))
        }
    }
fn parse_tags ( msg : & ' a str ) -> Result < ( Option < Tags < ' a > > , usize ) > { let mut map = Tags :: default ( ) ; if let Some ( idx ) = msg . find ( " " ) { let tag = & msg [ .. idx ] ; let toks = tag . split ( ';' ) ; for tok in toks { let items = tok . split ( '=' ) . collect :: < Vec < _ > > ( ) ; let key = items [ 0 ] ; let val = items [ 1 ] ; map . insert ( key , TagValue :: new ( val ) ) ; } Ok ( ( Some ( map ) , idx + 3 ) ) } else { Err ( Error :: new ( ErrorKind :: Other , " " ) ) } }
Helper function for parsing message tags.
Helper function for parsing message tags .
msg
&'a str
msg
&'a str