Skip to content

Commit

Permalink
fix(derive): unqualified use of std::time::Duration in macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
t3hmrman committed Oct 18, 2023
1 parent 9bc2df6 commit b61b73c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/async-dropper-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b61b73c

Please sign in to comment.