passionfruit 1.1.0

An image downloader package with automatic file extension appendage.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use tokio;
use directories;
use passionfruit;


#[tokio::main]
async fn main() {
    match passionfruit::Download::new("https://i.imgur.com/ISfpRae.jpeg").start().await {
        Ok(result) => {
            if let Ok(_) = result.write_to(directories::UserDirs::new().unwrap().desktop_dir().unwrap().to_str().unwrap().to_string(), "lol".to_string()) {
                println!("Download completed!")
            }
        }
        Err(why) => panic!("It appears something went wrong: {}", why)
    }
}