[−][src]Function clean_url::utils::parse_url
pub fn parse_url(url: String, is_secure: bool) -> Option<String>
This function parses an incomplete URL and returns the full URL.
Usage:
use clean_url::utils::parse_url; assert_eq!(Some(String::from("http://example.com/")), parse_url(String::from("example.com"), false)); assert_eq!(Some(String::from("https://example.com/")), parse_url(String::from("example.com"), true)); assert_eq!(Some(String::from("http://www.example.com/")), parse_url(String::from("www.example.com"), false)); assert_eq!(Some(String::from("https://www.example.com/")), parse_url(String::from("www.example.com"), true));