remove dead code
This commit is contained in:
parent
ab71ee7a92
commit
aff5f47dce
1 changed files with 0 additions and 30 deletions
|
|
@ -1,8 +1,3 @@
|
|||
use rustc_data_structures::sync::Lock;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
|
@ -26,31 +21,6 @@ pub fn to_readable_str(mut val: usize) -> String {
|
|||
groups.join("_")
|
||||
}
|
||||
|
||||
pub fn record_time<T, F>(accu: &Lock<Duration>, f: F) -> T
|
||||
where
|
||||
F: FnOnce() -> T,
|
||||
{
|
||||
let start = Instant::now();
|
||||
let rv = f();
|
||||
let duration = start.elapsed();
|
||||
let mut accu = accu.lock();
|
||||
*accu += duration;
|
||||
rv
|
||||
}
|
||||
|
||||
pub fn indent<R, F>(op: F) -> R
|
||||
where
|
||||
R: Debug,
|
||||
F: FnOnce() -> R,
|
||||
{
|
||||
// Use in conjunction with the log post-processor like `src/etc/indenter`
|
||||
// to make debug output more readable.
|
||||
debug!(">>");
|
||||
let r = op();
|
||||
debug!("<< (Result = {:?})", r);
|
||||
r
|
||||
}
|
||||
|
||||
pub struct Indenter {
|
||||
_cannot_construct_outside_of_this_module: (),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue