diff --git a/README.md b/README.md index 3124cb7..76525e0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ A pixiv downloader written in Rust. - [ ] Add support for multiple threads download. - [ ] Batch download. - [ ] Fanbox support. +### TODO - CVE - [ ] Remove parse_duration dependency which used in unittest. ## Rust features flags ### all diff --git a/proc_macros/proc_macros.rs b/proc_macros/proc_macros.rs index 50d25d0..4e070b7 100644 --- a/proc_macros/proc_macros.rs +++ b/proc_macros/proc_macros.rs @@ -8,7 +8,6 @@ use syn::parse_macro_input; use syn::Ident; use syn::ItemFn; use syn::LitInt; -use syn::LitStr; #[proc_macro] pub fn define_struct_reader_fn(item: TokenStream) -> TokenStream { @@ -92,8 +91,7 @@ pub fn async_timeout_test(attr: TokenStream, item: TokenStream) -> TokenStream { sig, block, } = parse_macro_input!(item as ItemFn); - let meta = parse_macro_input!(attr as LitStr); - let dura = parse_duration::parse(meta.value().as_str()).unwrap(); + let dura = parse_duration::parse(attr.to_string().as_str()).unwrap(); let secs = LitInt::new(format!("{}", dura.as_secs()).as_str(), sig.ident.span()); let nanos = LitInt::new( format!("{}", dura.subsec_nanos()).as_str(), diff --git a/src/downloader/downloader.rs b/src/downloader/downloader.rs index 96a909a..10fc9d9 100644 --- a/src/downloader/downloader.rs +++ b/src/downloader/downloader.rs @@ -679,7 +679,7 @@ impl Drop for Dow } } -#[proc_macros::async_timeout_test("100s")] +#[proc_macros::async_timeout_test(120s)] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_downloader() { let p = Path::new("./test"); @@ -721,7 +721,7 @@ async fn test_downloader() { } } -#[proc_macros::async_timeout_test("60s")] +#[proc_macros::async_timeout_test(120s)] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_failed_downloader() { let p = Path::new("./test"); @@ -758,7 +758,7 @@ async fn test_failed_downloader() { } } -#[proc_macros::async_timeout_test("60s")] +#[proc_macros::async_timeout_test(120s)] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_downloader_dropped() { let p = Path::new("./test");