aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-03-26 00:30:48 -0400
committerJesse Luehrs <doy@tozt.net>2023-03-26 00:31:13 -0400
commit2389d219ae9b4b72a603bffd23c1c0d7ca99f270 (patch)
treefe1becb32f939664926ad7a01b2e451987d54374
parent688bc5177951ce01d22395a1aa8ed7d43d23d73e (diff)
downloadfancy-prompt-2389d219ae9b4b72a603bffd23c1c0d7ca99f270.tar.gz
fancy-prompt-2389d219ae9b4b72a603bffd23c1c0d7ca99f270.zip
fix verbose feature too
-rw-r--r--src/verbose.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/verbose.rs b/src/verbose.rs
index 1b02799..048f253 100644
--- a/src/verbose.rs
+++ b/src/verbose.rs
@@ -1,7 +1,4 @@
#[cfg(feature = "verbose")]
-use std;
-
-#[cfg(feature = "verbose")]
pub static mut STACK: Option<
Vec<(String, std::time::Instant, std::time::Instant)>,
> = None;
@@ -9,10 +6,9 @@ pub static mut STACK: Option<
#[cfg(feature = "verbose")]
macro_rules! start_talking_about_time {
($category:expr) => {
- use std;
- use verbose;
unsafe {
- let stack = verbose::STACK.get_or_insert_with(|| Vec::new());
+ let stack =
+ crate::verbose::STACK.get_or_insert_with(|| Vec::new());
let len = stack.len();
let now = std::time::Instant::now();
let category = $category;
@@ -26,7 +22,8 @@ macro_rules! start_talking_about_time {
macro_rules! talk_about_time {
($what:expr) => {
unsafe {
- let stack = verbose::STACK.get_or_insert_with(|| Vec::new());
+ let stack =
+ crate::verbose::STACK.get_or_insert_with(|| Vec::new());
let len = stack.len();
let last = stack.last_mut().unwrap();
let elapsed = last.1.elapsed();
@@ -47,7 +44,8 @@ macro_rules! talk_about_time {
macro_rules! stop_talking_about_time {
() => {
unsafe {
- let stack = verbose::STACK.get_or_insert_with(|| Vec::new());
+ let stack =
+ crate::verbose::STACK.get_or_insert_with(|| Vec::new());
let last = stack.pop().unwrap();
let elapsed = last.2.elapsed();
let len = stack.len();