main.rs
This file
Path
src/main.rs
51 lines · 1.2 KiB · Rust
Last changed by
Move to timer moduleDavid Peterbefore adoption0ffc6d7
History of this fileTake it
The walk stopped after 200 commits: lines older than 699d8ca point at it.
Add ARM binariesDavid Peterbefore adoption699d8ca
lines 1–2why, one step back1use std::env;2Introduce Commands structDavid Peterbefore adoptiona6baf49
line 3why, one step back3use app::get_cli_arguments;New Scheduler structDavid Peterbefore adoption72d2772
line 4why, one step back4use benchmark::scheduler::Scheduler;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;Add ARM binariesDavid Peterbefore adoption699d8ca
lines 10–11why, one step back10use colored::*;11Flat directory/module structureDavid Peterbefore adoption30c381f
lines 12–18why, one step back12pub mod app;13pub mod benchmark;14pub 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;Flat directory/module structureDavid Peterbefore adoption30c381f
line 21why, one step back21pub mod timer;Move a few modules to utilDavid Peterbefore adoption5c634c9
line 22why, one step back22pub mod util;Add ARM binariesDavid Peterbefore adoption699d8ca
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)?;Add ARM binariesDavid Peterbefore adoption699d8ca
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}Add ARM binariesDavid Peterbefore adoption699d8ca
line 42why, one step back42Unified error handlingDavid Peterbefore adoption2040810
lines 43–44why, one step back43fn main() {44 match run() {Add ARM binariesDavid Peterbefore adoption699d8ca
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 }Add ARM binariesDavid Peterbefore adoption699d8ca
lines 50–51why, one step back50 }51}