diff --git a/src/main.rs b/src/main.rs index 8226a4e..edfb4de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,7 +24,7 @@ use std::time::Duration; mod util; use util::*; -const ILIAS_URL: &'static str = "https://ilias.studium.kit.edu/"; +const ILIAS_URL: &str = "https://ilias.studium.kit.edu/"; #[tokio::main] async fn main() { @@ -61,9 +61,7 @@ async fn main() { let mut path = ilias.opt.output.clone(); path.push(item.name()); let ilias = Arc::clone(&ilias); - task::spawn(async { - process_gracefully(ilias, path, item).await; - }); + task::spawn(process_gracefully(ilias, path, item)); } }, Err(e) => println!("{:?}", e) @@ -184,9 +182,7 @@ fn process(ilias: Arc, mut path: PathBuf, obj: Object) -> impl Future { @@ -201,9 +197,7 @@ fn process(ilias: Arc, mut path: PathBuf, obj: Object) -> impl Future { @@ -227,8 +221,8 @@ fn process(ilias: Arc, mut path: PathBuf, obj: Object) -> impl Future, mut path: PathBuf, obj: Object) -> impl Future, mut path: PathBuf, obj: Object) -> impl Future, mut path: PathBuf, obj: Object) -> impl Future 0 { log!(0, "Ignoring older threads in {:?}..", path); @@ -376,12 +367,10 @@ fn process(ilias: Arc, mut path: PathBuf, obj: Object) -> impl Future, mut path: PathBuf, obj: Object) -> impl Future, mut path: PathBuf, obj: Object) -> impl Future { @@ -441,7 +426,7 @@ fn process(ilias: Arc, mut path: PathBuf, obj: Object) -> impl Future Result<()> { if let Err(e) = tokio::fs::create_dir(&path).await { if e.kind() != tokio::io::ErrorKind::AlreadyExists { - Err(e)?; + return Err(e.into()); } } Ok(())