[][src]Function clean_url::utils::swap_www

pub async fn swap_www<'_>(url: &'_ str) -> String

Removes www if a URL has it, and adds www if a URL does not

Usage:

use clean_url::utils::swap_www;
use tokio_test::block_on;

assert_eq!(String::from("http://www.example.com"), block_on(swap_www("http://example.com")));
assert_eq!(String::from("http://example.com"), block_on(swap_www("http://www.example.com")));