Skip to content
Myr

Remove extra trait, clean up cfg statements

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Steve Pentland · committed by sharkdp · parent 6c7e102 · Browse files · 4 files+28 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+28 added−23 removed

  • other:+28 added−23 removed

4 files+28 added−23 removed

modified:src/hyperfine/timer/mod.rs+9 added-18 removed
1mod internal;23pub mod wallclocktimer;45#[cfg(not(windows))]6mod unix_timer;78#[cfg(not(windows))]9pub use self::unix_timer::get_cpu_timer;1011#[cfg(windows)]12mod windows_timer;1314#[cfg(windows)]15pub use self::windows_timer::get_cpu_timer;165cfg_if! {6 if #[cfg(windows)] {7 mod windows_timer;8 pub use self::windows_timer::get_cpu_timer;9 } else {10 mod unix_timer;11 pub use self::unix_timer::get_cpu_timer;12 }13}14use std::process::Child;1519pub trait Timer20where21 Self: TimerStart + TimerStop,22{23}2416/// Defines start functionality of a timer.17pub trait TimerStart {18 fn start() -> Self;19 fn start_for_process(process: &Child) -> Self;
7 unmodified lines
modified:src/main.rs+11 added-5 removed
1extern crate atty;23#[macro_use]4extern crate cfg_if;56#[macro_use]7extern crate clap;8extern crate colored;9extern crate indicatif;10extern crate statistical;118#[cfg(not(windows))]9extern crate libc;12cfg_if! {13 if #[cfg(windows)] {14 extern crate winapi;15 } else {16 extern crate libc;17 }18}1911#[cfg(windows)]12extern crate winapi;1320#[cfg(test)]21#[macro_use]22extern crate approx;23
150 unmodified lines
modified:Cargo.lock+7 added
30 unmodified lines
31version = "1.0.1"32source = "registry+https://github.com/rust-lang/crates.io-index"3334[[package]]35name = "cfg-if"36version = "0.1.2"37source = "registry+https://github.com/rust-lang/crates.io-index"3839[[package]]40name = "clap"41version = "2.29.2"42source = "registry+https://github.com/rust-lang/crates.io-index"43dependencies = [
59 unmodified lines
103version = "0.4.0"104dependencies = [105 "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",106 "atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",107 "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",108 "clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)",109 "colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",110 "indicatif 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",111 "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
309 unmodified lines
421"checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455"422"checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94"423"checksum atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8352656fd42c30a0c3c89d26dea01e3b77c0ab2af18230835c15e2e13cd51859"424"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"425"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"426"checksum clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4151c5790817c7d21bbdc6c3530811f798172915f93258244948b93ba19604a6"427"checksum clicolors-control 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f84dec9bc083ce2503908cd305af98bd363da6f54bf8d4bf0ac14ee749ad5d1"428"checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc"429"checksum console 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7649ca90478264b9686aac8d269fcb014f14c2bed7c79a7e51b9f6afd4d783eb"
42 unmodified lines
modified:Cargo.toml+1 added