fn download_logic(item: &rss::Item, wl_title: &str) -> u8 {
    let e: u8 = 0;
    let title = item.title().expect("Failed to extract title");
    if tracking_check((&title).to_string(), &wl_title) {
        e
    } else {
        // Get the link of the item
        println!("Downloading {}", &title);
        let link = item.link();
        let target = match link {
            Some(link) => link,
            _ => return 0,
        };
        //FIXME: There's currently no way of checking if the item has already been downloaded.
        if target.contains("magnet:") {
            info!("Downloaded {}", &title);
            match opener::open(&target) {
                Ok(_) => 1,
                Err(_) => e,
            }
        } else {
            // Download the given link
            let result = downloader(target, &title.to_string());
            match result {
                Ok(r) => r,
                Err(_) => e,
            }
        }
    }
}
/// Initializes the download function then passes on the target link
/// to the downloader function
Initializes the download function then passes on the target link
to the downloader function
Initializes the download function then passes on the target link to the downloader function
fn download_logic(item: &rss::Item, wl_title: &str) -> u8 {
    let e: u8 = 0;
    let title = item.title().expect("Failed to extract title");
    if tracking_check((&title).to_string(), &wl_title) {
        e
    } else {
        // Get the link of the item
        println!("Downloading {}", &title);
        let link = item.link();
        let target = match link {
            Some(link) => link,
            _ => return 0,
        };
        //FIXME: There's currently no way of checking if the item has already been downloaded.
        if target.contains("magnet:") {
            info!("Downloaded {}", &title);
            match opener::open(&target) {
                Ok(_) => 1,
                Err(_) => e,
            }
        } else {
            // Download the given link
            let result = downloader(target, &title.to_string());
            match result {
                Ok(r) => r,
                Err(_) => e,
            }
        }
    }
}
fn download_logic ( item : & rss :: Item , wl_title : & str ) -> u8 { let e : u8 = 0 ; let title = item . title ( ) . expect ( " " ) ; if tracking_check ( ( & title ) . to_string ( ) , & wl_title ) { e } else { // Get the link of the item println ! ( " " title ) ; let link = item . link ( ) ; let target = match link { Some ( link ) => link , _ => return 0 , } ; //FIXME: There's currently no way of checking if the item has already been downloaded. if target . contains ( " " ) { info ! ( " " title ) ; match opener :: open ( & target ) { Ok ( _ ) => 1 , Err ( _ ) => e , } } else { // Download the given link let result = downloader ( target , & title . to_string ( ) ) ; match result { Ok ( r ) => r , Err ( _ ) => e , } } } }
Initializes the download function then passes on the target link
to the downloader function
Initializes the download function then passes on the target link to the downloader function
item
&rss::Item
wl_title
&str
item
&rss::Item
wl_title
&str