1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! This module provides a utility function for downloading files from a given URL.
use ;
use fs;
/// Downloads a file from a URL and saves it to a specified output path.
///
/// The function extracts the filename from the URL and appends it to `out_path`.
///
/// # Arguments
///
/// * `url` - The URL of the file to download.
/// * `out_path` - The directory path where the file will be saved.
///
/// # Example
///
/// ```
/// # use tokio_test;
/// # use crate::sked::utils::download_file;
/// # tokio_test::block_on(async {
/// let url = "https://crates.io/assets/cargo.png".to_string();
/// let out_path = "/tmp/".to_string();
/// download_file(url, out_path).await.unwrap();
/// # })
/// ```
pub async