/// Split the URL info 4 parts (protocol, address, port and path)
Split the URL info 4 parts (protocol, address, port and path)
Split the URL info 4 parts ( protocol address port and path )
pub fn split_url(url: &str) -> (enums::Protocol, String, u16, String)   {
        let (proto, rest) = helpers::split_in_two(url, "://");
        let (addr, rest) = helpers::split_in_two(&rest, ":");
        let (port, path) = helpers::split_in_two(&rest, "/");
        let p = helpers::parse_panic::<u16>(&port);
        let protocol = match proto.as_ref()  {
            "HTTP" => enums::Protocol::HTTP,
            "HTTPS" => enums::Protocol::HTTPS,
            _       => enums::Protocol::HTTP,
        };
        (protocol, addr, p, path)
    }
pub fn split_url ( url : & str ) -> ( enums :: Protocol , String , u16 , String ) { let ( proto , rest ) = helpers :: split_in_two ( url , " " ) ; let ( addr , rest ) = helpers :: split_in_two ( & rest , " " ) ; let ( port , path ) = helpers :: split_in_two ( & rest , " " ) ; let p = helpers :: parse_panic :: < u16 > ( & port ) ; let protocol = match proto . as_ref ( ) { " " => enums :: Protocol :: HTTP , " " => enums :: Protocol :: HTTPS , _ => enums :: Protocol :: HTTP , } ; ( protocol , addr , p , path ) }
Split the URL info 4 parts (protocol, address, port and path)
Split the URL info 4 parts ( protocol address port and path )
url
&str