Re-order imports

This commit is contained in:
David Peter authored and David Peter committed 2021-08-24 22:44:08 +02:00
1 parent 30c381fe2a
commit 9df6174bc2
16 files changed
+45 -44

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
use std::ffi::OsString;
use atty::Stream;
use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
use std::ffi::OsString;
pub fn get_arg_matches<I, T>(args: I) -> ArgMatches<'static>
where
+2 -1
View File
@@ -1,6 +1,7 @@
use serde::Serialize;
use std::collections::BTreeMap;
use serde::Serialize;
use crate::units::Second;
/// Set of values that will be exported.
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::BTreeMap;
use std::fmt;
use super::types::ParameterValue;
use crate::types::ParameterValue;
/// A command that should be benchmarked.
#[derive(Debug, Clone, PartialEq, Eq)]
+2 -1
View File
@@ -1,9 +1,10 @@
use rust_decimal::Error as DecimalError;
use std::error::Error;
use std::fmt;
use std::num;
use std::num::ParseIntError;
use rust_decimal::Error as DecimalError;
#[derive(Debug)]
pub enum ParameterScanError {
ParseIntError(num::ParseIntError),
+2 -3
View File
@@ -1,11 +1,10 @@
use super::Exporter;
use std::io::Result;
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::format::format_duration_value;
use crate::units::Unit;
use std::io::Result;
#[derive(Default)]
pub struct AsciidocExporter {}
+4 -5
View File
@@ -1,13 +1,12 @@
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::units::Unit;
use std::borrow::Cow;
use std::io::{Error, ErrorKind, Result};
use csv::WriterBuilder;
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::units::Unit;
#[derive(Default)]
pub struct CsvExporter {}
+4 -4
View File
@@ -1,12 +1,12 @@
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::units::Unit;
use std::io::{Error, ErrorKind, Result};
use serde::*;
use serde_json::to_vec_pretty;
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::units::Unit;
#[derive(Serialize, Debug)]
struct HyperfineSummary<'a> {
results: &'a [BenchmarkResult],
+2 -3
View File
@@ -1,12 +1,11 @@
use super::Exporter;
use std::io::{Error, ErrorKind, Result};
use super::Exporter;
use crate::benchmark_result::BenchmarkResult;
use crate::format::format_duration_value;
use crate::internal::{compute_relative_speed, BenchmarkResultWithRelativeSpeed};
use crate::units::Unit;
use std::io::{Error, ErrorKind, Result};
#[derive(Default)]
pub struct MarkdownExporter {}
+3 -3
View File
@@ -1,3 +1,6 @@
use std::fs::{File, OpenOptions};
use std::io::{Result, Write};
mod asciidoc;
mod csv;
mod json;
@@ -8,9 +11,6 @@ use self::csv::CsvExporter;
use self::json::JsonExporter;
use self::markdown::MarkdownExporter;
use std::fs::{File, OpenOptions};
use std::io::{Result, Write};
use crate::benchmark_result::BenchmarkResult;
use crate::units::Unit;
+3 -3
View File
@@ -1,3 +1,6 @@
use std::cmp::Ordering;
use std::iter::Iterator;
use colored::*;
use indicatif::{ProgressBar, ProgressStyle};
@@ -5,9 +8,6 @@ use crate::benchmark_result::BenchmarkResult;
use crate::options::OutputStyleOption;
use crate::units::{Scalar, Second};
use std::cmp::Ordering;
use std::iter::Iterator;
/// Threshold for warning about fast execution time
pub const MIN_EXECUTION_TIME: Second = 5e-3;
+1 -1
View File
@@ -1,4 +1,4 @@
use super::units::{Second, Unit};
use crate::units::{Second, Unit};
#[cfg(not(windows))]
pub const DEFAULT_SHELL: &str = "sh";
+7 -6
View File
@@ -1,9 +1,10 @@
/// A module for statistical outlier detection.
///
/// References:
/// - Boris Iglewicz and David Hoaglin (1993), "Volume 16: How to Detect and Handle Outliers",
/// The ASQC Basic References in Quality Control: Statistical Techniques, Edward F. Mykytka,
/// Ph.D., Editor.
//! A module for statistical outlier detection.
//!
//! References:
//! - Boris Iglewicz and David Hoaglin (1993), "Volume 16: How to Detect and Handle Outliers",
//! The ASQC Basic References in Quality Control: Statistical Techniques, Edward F. Mykytka,
//! Ph.D., Editor.
use statistical::median;
/// Minimum modified Z-score for a datapoint to be an outlier. Here, 1.4826 is a factor that
+3 -3
View File
@@ -1,12 +1,12 @@
#![cfg(not(windows))]
use std::mem;
use std::process::Child;
use super::internal::{CPUInterval, CPUTimes};
use crate::timer::{TimerStart, TimerStop};
use crate::units::Second;
use std::mem;
use std::process::Child;
pub fn get_cpu_timer() -> Box<dyn TimerStop<Result = (Second, Second)>> {
Box::new(CPUTimer::start())
}
+7 -7
View File
@@ -1,16 +1,16 @@
#![cfg(windows)]
use super::internal::CPUTimes;
use crate::timer::{TimerStart, TimerStop};
use crate::units::Second;
use winapi::um::processthreadsapi::GetProcessTimes;
use winapi::um::winnt::HANDLE;
use std::mem;
use std::os::windows::io::{AsRawHandle, RawHandle};
use std::process::Child;
use winapi::um::processthreadsapi::GetProcessTimes;
use winapi::um::winnt::HANDLE;
use super::internal::CPUTimes;
use crate::timer::{TimerStart, TimerStop};
use crate::units::Second;
const HUNDRED_NS_PER_MS: i64 = 10;
pub fn get_cpu_timer(process: &Child) -> Box<dyn TimerStop<Result = (Second, Second)>> {
+1 -1
View File
@@ -1,9 +1,9 @@
use serde::Serialize;
use std::convert::TryFrom;
use std::fmt;
use rust_decimal::prelude::ToPrimitive;
use rust_decimal::Decimal;
use serde::Serialize;
#[derive(Debug, Clone, Serialize, Copy, PartialEq, Eq)]
#[serde(untagged)]
+1 -1
View File
@@ -1,4 +1,4 @@
/// This module contains common units.
//! This module contains common units.
pub type Scalar = f64;