fn parse_ipv6(lexer: &mut Lexer, err_msg: &'static str) -> crate::Result<String> {
    let _ = lexer.next();
    let mut output = String::from('[');

    loop {
        match lexer.next().kind() {
            TokenKind::Colon => output.push(':'),
            TokenKind::Atom(c) if c.is_ascii_alphanumeric() => output.push(*c),
            TokenKind::CloseBracket => {
                output.push(']');
                break;
            }
            _ => bail!(err_msg),
        }
    }

    ensure!(!output.is_empty(), err_msg);
    Ok(output)
}
/// Read a URL encoded IPv6 sequence into a string.
///
/// Example: `[2001:db8:85a3:8d3:1319:8a2e:370:7348]`
///
/// See also: https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers
Read a URL encoded IPv6 sequence into a string.


Read a URL encoded IPv6 sequence into a string .
fn parse_ipv6(lexer: &mut Lexer, err_msg: &'static str) -> crate::Result<String> {
    let _ = lexer.next();
    let mut output = String::from('[');
    loop {
        match lexer.next().kind() {
            TokenKind::Colon => output.push(':'),
            TokenKind::Atom(c) if c.is_ascii_alphanumeric() => output.push(*c),
            TokenKind::CloseBracket => {
                output.push(']');
                break;
            }
            _ => bail!(err_msg),
        }
    }
    ensure!(!output.is_empty(), err_msg);
    Ok(output)
}
fn parse_ipv6 ( lexer : & mut Lexer , err_msg : & ' static str ) -> crate :: Result < String > { let _ = lexer . next ( ) ; let mut output = String :: from ( '[' ) ; loop { match lexer . next ( ) . kind ( ) { TokenKind :: Colon => output . push ( ':' ) , TokenKind :: Atom ( c ) if c . is_ascii_alphanumeric ( ) => output . push ( * c ) , TokenKind :: CloseBracket => { output . push ( ']' ) ; break ; } _ => bail ! ( err_msg ) , } } ensure ! ( output is_empty ( ) err_msg ) ; Ok ( output ) }
Read a URL encoded IPv6 sequence into a string.
Read a URL encoded IPv6 sequence into a string .
lexer
&mut Lexer
err_msg
&'static str
lexer
&mut Lexer
err_msg
&'static str