Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than 699d8ca point at it.

Add ARM binariesDavid Peterbefore adoption699d8ca

lines 1–2why, one step back
1use std::env;
2

Introduce Commands structDavid Peterbefore adoptiona6baf49

line 3why, one step back
3use app::get_cli_arguments;

New Scheduler structDavid Peterbefore adoption72d2772

line 4why, one step back
4use benchmark::scheduler::Scheduler;

Introduce Commands structDavid Peterbefore adoptiona6baf49

line 5why, one step back
5use command::Commands;

New parameter moduleDavid Peterbefore adoption47091a5

line 6why, one step back
6use export::ExportManager;

New schedule moduleDavid Peterbefore adoptionc5a2266

line 7why, one step back
7use options::Options;

New parameter moduleDavid Peterbefore adoption47091a5

line 8why, one step back
8

New schedule moduleDavid Peterbefore adoptionc5a2266

line 9why, one step back
9use anyhow::Result;

Add ARM binariesDavid Peterbefore adoption699d8ca

lines 10–11why, one step back
10use colored::*;
11

Flat directory/module structureDavid Peterbefore adoption30c381f

lines 12–18why, one step back
12pub 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 back
19pub mod output;

New parameter moduleDavid Peterbefore adoption47091a5

line 20why, one step back
20pub mod parameter;

Flat directory/module structureDavid Peterbefore adoption30c381f

line 21why, one step back
21pub mod timer;

Move a few modules to utilDavid Peterbefore adoption5c634c9

line 22why, one step back
22pub mod util;

Add ARM binariesDavid Peterbefore adoption699d8ca

line 23why, one step back
23

Unified error handlingDavid Peterbefore adoption2040810

line 24why, one step back
24fn run() -> Result<()> {

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 25–28why, one step back
25 // Enabled ANSI colors on Windows 10
26 #[cfg(windows)]27 colored::control::set_virtual_terminal(true).unwrap();28

Introduce Commands structDavid Peterbefore adoptiona6baf49

lines 29–32why, one step back
29 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 back
33

New Scheduler structDavid Peterbefore adoption72d2772

lines 34–40why, one step back
34 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 back
41}

Add ARM binariesDavid Peterbefore adoption699d8ca

line 42why, one step back
42

Unified error handlingDavid Peterbefore adoption2040810

lines 43–44why, one step back
43fn main() {
44 match run() {

Add ARM binariesDavid Peterbefore adoption699d8ca

line 45why, one step back
45 Ok(_) => {}

Unified error handlingDavid Peterbefore adoption2040810

lines 46–49why, one step back
46 Err(e) => {
47 eprintln!("{} {:#}", "Error:".red(), e);48 std::process::exit(1);49 }

Add ARM binariesDavid Peterbefore adoption699d8ca

lines 50–51why, one step back
50 }
51}