Skip to content
Myr

create_export_manager -> ExportManager::new

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent aabe133 · Browse files · 2 files+10 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−11 removed

  • other:+10 added−11 removed

2 files+10 added−11 removed

modified:src/hyperfine/export/mod.rs+8 added-9 removed
71 unmodified lines
72 /// Export the given entries in the serialized form.73 fn serialize(&self, values: &Vec<ExportEntry>) -> Result<Vec<u8>>;74}7576/// Create a new ExportManager77pub fn create_export_manager() -> ExportManager {78 ExportManager {79 exporters: Vec::new(),80 }81}8283/// The ExportManager handles the management of multiple file84/// exporters.76/// Handles the management of multiple file exporters.77pub struct ExportManager {78 exporters: Vec<ExportType>,79}8081impl ExportManager {82 /// Create a new ExportManager83 pub fn new() -> ExportManager {84 ExportManager {85 exporters: Vec::new(),86 }87 }8889 /// Add an additional exporter to the ExportManager90 pub fn add_exporter(&mut self, for_type: ExportType) {91 self.exporters.push(for_type);92 }
22 unmodified lines
modified:src/main.rs+2 added-2 removed
37 unmodified lines
38mod hyperfine;3940use hyperfine::internal::{CmdFailureAction, HyperfineOptions, OutputStyleOption};41use hyperfine::benchmark::{mean_shell_spawning_time, run_benchmark};42use hyperfine::export::{create_export_manager, ExportEntry, ExportManager, ExportType};42use hyperfine::export::{ExportEntry, ExportManager, ExportType};4344/// Print error message to stderr and terminate45pub fn error(message: &str) -> ! {46 eprintln!("{} {}", "Error:".red(), message);
175 unmodified lines
222 if targets.json_file.is_none() && targets.csv_file.is_none() {223 return None;224 }225226 let mut export_manager = create_export_manager();226 let mut export_manager = ExportManager::new();227228 if let Some(filename) = targets.json_file {229 export_manager.add_exporter(ExportType::Json(filename.to_string()));230 }
6 unmodified lines