From b61b73cbeef9b75780b9fd2c2b03c582ca18ef67 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 18 Oct 2023 16:38:27 +0900 Subject: [PATCH] fix(derive): unqualified use of std::time::Duration in macro Up until now, the Duration used in AsyncDrop#drop_timeout was unqualified, which meant that downstream users of the lib would get errors since the struct wasn't imported. This commit qualifies use of Duration in the generated code for the AsyncDrop derive macro to avoid errors/forcing downstream consumers to `use std::time::Duration`. Signed-off-by: vados --- crates/async-dropper-derive/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/async-dropper-derive/src/lib.rs b/crates/async-dropper-derive/src/lib.rs index 373aad0..932f0ac 100644 --- a/crates/async-dropper-derive/src/lib.rs +++ b/crates/async-dropper-derive/src/lib.rs @@ -131,8 +131,8 @@ fn gen_preamble(di: &DeriveInput) -> proc_macro2::TokenStream { } /// Timeout for drop operation, meant to be overriden if needed - fn drop_timeout(&self) -> Duration { - Duration::from_secs(3) + fn drop_timeout(&self) -> std::time::Duration { + std::time::Duration::from_secs(3) } /// What to do what a drop fails