Remove extra trait, clean up cfg statements

This commit is contained in:
Steve Pentland authored and sharkdp committed 2018-02-13 21:02:32 +01:00
1 parent 6c7e102a24
commit cad3d0c8e4
4 files changed
+28 -23

No files matched your search

+9 -18
View File
@@ -2,25 +2,16 @@ mod internal;
pub mod wallclocktimer;
#[cfg(not(windows))]
mod unix_timer;
#[cfg(not(windows))]
pub use self::unix_timer::get_cpu_timer;
#[cfg(windows)]
mod windows_timer;
#[cfg(windows)]
pub use self::windows_timer::get_cpu_timer;
use std::process::Child;
pub trait Timer
where
Self: TimerStart + TimerStop,
{
cfg_if! {
if #[cfg(windows)] {
mod windows_timer;
pub use self::windows_timer::get_cpu_timer;
} else {
mod unix_timer;
pub use self::unix_timer::get_cpu_timer;
}
}
use std::process::Child;
/// Defines start functionality of a timer.
pub trait TimerStart {
+11 -5
View File
@@ -1,15 +1,21 @@
extern crate atty;
#[macro_use]
extern crate cfg_if;
#[macro_use]
extern crate clap;
extern crate colored;
extern crate indicatif;
extern crate statistical;
#[cfg(not(windows))]
extern crate libc;
#[cfg(windows)]
extern crate winapi;
cfg_if! {
if #[cfg(windows)] {
extern crate winapi;
} else {
extern crate libc;
}
}
#[cfg(test)]
#[macro_use]