summaryrefslogtreecommitdiffstats
path: root/scopetime
diff options
context:
space:
mode:
authorStephan Dilly <dilly.stephan@gmail.com>2021-08-17 14:24:25 +0200
committerStephan Dilly <dilly.stephan@gmail.com>2021-08-17 14:24:25 +0200
commitdad8e8d43de79a3c39a37f118e529dc88fab5495 (patch)
tree32329a450106142d35374c88b776c74a679bd9a0 /scopetime
parent25a49e22f267f467fb7436c799e1d01294e0a914 (diff)
cargo fmt: use hardtabs
since it does not support hard-whitespaces its the only way to make whitespaces consisitent and checked
Diffstat (limited to 'scopetime')
-rw-r--r--scopetime/src/lib.rs80
1 files changed, 40 insertions, 40 deletions
diff --git a/scopetime/src/lib.rs b/scopetime/src/lib.rs
index 24fb13ef..0cf774b5 100644
--- a/scopetime/src/lib.rs
+++ b/scopetime/src/lib.rs
@@ -10,63 +10,63 @@ use std::time::Instant;
///
pub struct ScopeTimeLog<'a> {
- title: &'a str,
- mod_path: &'a str,
- file: &'a str,
- line: u32,
- time: Instant,
+ title: &'a str,
+ mod_path: &'a str,
+ file: &'a str,
+ line: u32,
+ time: Instant,
}
///
impl<'a> ScopeTimeLog<'a> {
- ///
- pub fn new(
- mod_path: &'a str,
- title: &'a str,
- file: &'a str,
- line: u32,
- ) -> Self {
- Self {
- title,
- mod_path,
- file,
- line,
- time: Instant::now(),
- }
- }
+ ///
+ pub fn new(
+ mod_path: &'a str,
+ title: &'a str,
+ file: &'a str,
+ line: u32,
+ ) -> Self {
+ Self {
+ title,
+ mod_path,
+ file,
+ line,
+ time: Instant::now(),
+ }
+ }
}
impl<'a> Drop for ScopeTimeLog<'a> {
- fn drop(&mut self) {
- log::trace!(
- "scopetime: {:?} ms [{}::{}] @{}:{}",
- self.time.elapsed().as_millis(),
- self.mod_path,
- self.title,
- self.file,
- self.line,
- );
- }
+ fn drop(&mut self) {
+ log::trace!(
+ "scopetime: {:?} ms [{}::{}] @{}:{}",
+ self.time.elapsed().as_millis(),
+ self.mod_path,
+ self.title,
+ self.file,
+ self.line,
+ );
+ }
}
///
#[cfg(feature = "enabled")]
#[macro_export]
macro_rules! scope_time {
- ($target:literal) => {
- #[allow(unused_variables)]
- let time = $crate::ScopeTimeLog::new(
- module_path!(),
- $target,
- file!(),
- line!(),
- );
- };
+ ($target:literal) => {
+ #[allow(unused_variables)]
+ let time = $crate::ScopeTimeLog::new(
+ module_path!(),
+ $target,
+ file!(),
+ line!(),
+ );
+ };
}
#[doc(hidden)]
#[cfg(not(feature = "enabled"))]
#[macro_export]
macro_rules! scope_time {
- ($target:literal) => {};
+ ($target:literal) => {};
}