main.rs
This file
Path
src/main.rs
51 lines · 1.2 KiB · Rust
Last changed by
Update dependenciesDavid Peterbefore adoptionf2f1dd9
History of this fileTake it
The walk stopped after 200 commits: lines older than 76dd9d4 point at it.
Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
lines 1–2why, one step back1use std::env;2New Scheduler structDavid Peterbefore adoption72d2772
line 3why, one step back3use benchmark::scheduler::Scheduler;Update dependenciesDavid Peterbefore adoptionf2f1dd9
line 4why, one step back4use cli::get_cli_arguments;Introduce Commands structDavid Peterbefore adoptiona6baf49
line 5why, one step back5use command::Commands;New parameter moduleDavid Peterbefore adoption47091a5
line 6why, one step back6use export::ExportManager;New schedule moduleDavid Peterbefore adoptionc5a2266
line 7why, one step back7use options::Options;New parameter moduleDavid Peterbefore adoption47091a5
line 8why, one step back8New schedule moduleDavid Peterbefore adoptionc5a2266
line 9why, one step back9use anyhow::Result;Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
lines 10–12why, one step back10use colored::*;1112pub mod benchmark;Update dependenciesDavid Peterbefore adoptionf2f1dd9
line 13why, one step back13pub mod cli;Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
lines 14–18why, one step back14pub mod command;15pub mod error;16pub mod export;17pub mod options;18pub mod outlier_detection;New output moduleDavid Peterbefore adoption865290a
line 19why, one step back19pub mod output;New parameter moduleDavid Peterbefore adoption47091a5
line 20why, one step back20pub mod parameter;Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
line 21why, one step back21pub mod timer;Move a few modules to utilDavid Peterbefore adoption5c634c9
line 22why, one step back22pub mod util;Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
line 23why, one step back23Unified error handlingDavid Peterbefore adoption2040810
line 24why, one step back24fn run() -> Result<()> {Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8
lines 25–28why, one step back25 // Enabled ANSI colors on Windows 1026 #[cfg(windows)]27 colored::control::set_virtual_terminal(true).unwrap();28Introduce Commands structDavid Peterbefore adoptiona6baf49
lines 29–32why, one step back29 let cli_arguments = get_cli_arguments(env::args_os());30 let options = Options::from_cli_arguments(&cli_arguments)?;31 let commands = Commands::from_cli_arguments(&cli_arguments)?;32 let export_manager = ExportManager::from_cli_arguments(&cli_arguments)?;Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
line 33why, one step back33New Scheduler structDavid Peterbefore adoption72d2772
lines 34–40why, one step back34 options.validate_against_command_list(&commands)?;3536 let mut scheduler = Scheduler::new(&commands, &options, &export_manager);37 scheduler.run_benchmarks()?;38 scheduler.print_relative_speed_comparison();3940 Ok(())Unified error handlingDavid Peterbefore adoption2040810
line 41why, one step back41}Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
line 42why, one step back42Unified error handlingDavid Peterbefore adoption2040810
lines 43–44why, one step back43fn main() {44 match run() {Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
line 45why, one step back45 Ok(_) => {}Unified error handlingDavid Peterbefore adoption2040810
lines 46–49why, one step back46 Err(e) => {47 eprintln!("{} {:#}", "Error:".red(), e);48 std::process::exit(1);49 }Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4
lines 50–51why, one step back50 }51}