Function urlexpand::unshorten[][src]

pub fn unshorten(url: &str, timeout: Option<Duration>) -> Option<String>

UnShorten a shortened URL

Example

use std::time::Duration;
use urlexpand::unshorten;

fn main() {
    let url = "https://bit.ly/3alqLKi";
    assert!(unshorten(url, Some(Duration::from_secs(10))).is_some());   // with timeout
    assert!(unshorten(url, None).is_some());    // without timeout
}