diff rust/rhg/src/commands/debugdata.rs @ 49913:c15b415d1bff

rust: use `logging_timer` instead of `micro_timer` I am the author of `micro_timer`. I built it at the time because I couldn't find a crate that was simple to use and flexible to do function timing with. Turns out I just couldn't find it because crates.io's search isn't all that great, or maybe I didn't look hard enough. `logging_timer` is better in every way: - supports changing the logging level - supports start and end logging - supports intermediary messages - supports inline macros - supports formatting the output - better IDE/tree-sitter integration thanks to a more robust proc macro I also changed all uses to one-liners, so it's easier to copy-paste.
author Rapha?l Gom?s <rgomes@octobus.net>
date Fri, 06 Jan 2023 18:52:04 +0100
parents 37bc3edef76f
children 532e74ad3ff6
line wrap: on
line diff
--- a/rust/rhg/src/commands/debugdata.rs	Thu Jan 12 16:15:51 2023 +0000
+++ b/rust/rhg/src/commands/debugdata.rs	Fri Jan 06 18:52:04 2023 +0100
@@ -2,7 +2,6 @@
 use clap::Arg;
 use clap::ArgGroup;
 use hg::operations::{debug_data, DebugDataKind};
-use micro_timer::timed;
 
 pub const HELP_TEXT: &str = "
 Dump the contents of a data file revision
@@ -36,7 +35,7 @@
         .about(HELP_TEXT)
 }
 
-#[timed]
+#[logging_timer::time("trace")]
 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
     let args = invocation.subcommand_args;
     let rev = args