mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 17:00:18 +00:00
Remove alternative constructors
This commit is contained in:
1 parent
f57c4e6d78
commit
3494c8abe6
8 files changed
+112
-113
No files matched your search
@@ -9,9 +9,7 @@ use crate::options::{
|
||||
CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell,
|
||||
};
|
||||
use crate::output::progress_bar::get_progress_bar;
|
||||
use crate::quantity::Information;
|
||||
use crate::quantity::InformationQuantity;
|
||||
use crate::quantity::{Time, TimeQuantity};
|
||||
use crate::quantity::{byte, second, Information, Time, TimeQuantity};
|
||||
use crate::timer::execute_and_measure;
|
||||
use crate::util::randomized_environment_offset;
|
||||
|
||||
@@ -316,7 +314,7 @@ impl MockExecutor {
|
||||
|
||||
fn extract_time<S: AsRef<str>>(sleep_command: S) -> Time {
|
||||
assert!(sleep_command.as_ref().starts_with("sleep "));
|
||||
Time::from_seconds(
|
||||
Time::new::<second>(
|
||||
sleep_command
|
||||
.as_ref()
|
||||
.trim_start_matches("sleep ")
|
||||
@@ -350,7 +348,7 @@ impl Executor for MockExecutor {
|
||||
time_wall_clock: Self::extract_time(command.get_command_line()),
|
||||
time_user: Time::zero(),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(0),
|
||||
peak_memory_usage: Information::new::<byte>(0),
|
||||
exit_status,
|
||||
})
|
||||
}
|
||||
@@ -371,6 +369,6 @@ impl Executor for MockExecutor {
|
||||
fn test_mock_executor_extract_time() {
|
||||
assert_eq!(
|
||||
MockExecutor::extract_time("sleep 0.1"),
|
||||
Time::from_seconds(0.1)
|
||||
Time::new::<second>(0.1)
|
||||
);
|
||||
}
|
||||
@@ -154,13 +154,14 @@ fn create_result(name: &str, mean: f64) -> BenchmarkResult {
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use crate::benchmark::measurement::{Measurement, Measurements};
|
||||
use crate::quantity::second;
|
||||
|
||||
BenchmarkResult {
|
||||
command: name.into(),
|
||||
measurements: Measurements {
|
||||
measurements: vec![Measurement {
|
||||
time_wall_clock: Time::from_seconds(mean),
|
||||
time_user: Time::from_seconds(mean),
|
||||
time_wall_clock: Time::new::<second>(mean),
|
||||
time_user: Time::new::<second>(mean),
|
||||
..Default::default()
|
||||
}],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user