Skip to content

Commit bb1b635

Browse files
committed
feat: absolute imports, clippy pedantic mode
Signed-off-by: Richard Zak <[email protected]>
1 parent 83a0adc commit bb1b635

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/lib.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![doc = include_str!("../README.md")]
22
#![deny(missing_docs)]
33
#![deny(clippy::cargo)]
4+
#![deny(clippy::pedantic)]
45
#![forbid(unsafe_code)]
56
#![allow(unreachable_code)]
67

@@ -42,26 +43,26 @@ pub fn time_function(
4243
let output = if input.sig.asyncness.is_some() {
4344
quote! {
4445
async #func_vis fn #func_name(#func_input) #func_output {
45-
let start = std::time::Instant::now();
46+
let start = ::std::time::Instant::now();
4647
let result = (|| async #func_block)().await;
47-
let duration: std::time::Duration = start.elapsed();
48+
let duration: ::std::time::Duration = start.elapsed();
4849
#[cfg(not(feature = "tracing"))]
4950
println!("`{}` took {:?}", #func_label, duration);
5051
#[cfg(feature = "tracing")]
51-
tracing::trace!("`{}` took {:?}", #func_label, duration);
52+
::tracing::trace!("`{}` took {:?}", #func_label, duration);
5253
result
5354
}
5455
}
5556
} else {
5657
quote! {
5758
#func_vis fn #func_name(#func_input) #func_output {
58-
let start = std::time::Instant::now();
59+
let start = ::std::time::Instant::now();
5960
let result = (|| #func_block)();
60-
let duration: std::time::Duration = start.elapsed();
61+
let duration: ::std::time::Duration = start.elapsed();
6162
#[cfg(not(feature = "tracing"))]
6263
println!("`{}` took {:?}", #func_label, duration);
6364
#[cfg(feature = "tracing")]
64-
tracing::trace!("`{}` took {:?}", #func_label, duration);
65+
::tracing::trace!("`{}` took {:?}", #func_label, duration);
6566
result
6667
}
6768
}
@@ -83,14 +84,14 @@ pub fn time_snippet(input: TokenStream) -> TokenStream {
8384
let output = quote! {
8485
{
8586
let begin = line!();
86-
let start = std::time::Instant::now();
87+
let start = ::std::time::Instant::now();
8788
let result =
8889
#block;
89-
let duration: std::time::Duration = start.elapsed();
90+
let duration: ::std::time::Duration = start.elapsed();
9091
#[cfg(not(feature = "tracing"))]
9192
println!("{}:{} took {:?}.", file!(), begin, duration);
9293
#[cfg(feature = "tracing")]
93-
tracing::trace!("{}:{} took {:?}.", file!(), begin, duration);
94+
::tracing::trace!("{}:{} took {:?}.", file!(), begin, duration);
9495
result
9596
}
9697
};

0 commit comments

Comments
 (0)