Skip to content
Myr

Reduce repetition

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

authored by philipp · committed by David Peter · parent f3a20c2 · Browse files · 1 file+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

1 file+10 added−11 removed

  • other:+10 added−11 removed

1 file+10 added−11 removed

modified:src/main.rs+10 added-11 removed
214 unmodified lines
215/// Build the ExportManager that will export the results specified216/// in the given ArgMatches217fn build_export_manager(matches: &ArgMatches) -> ExportManager {218 let mut export_manager = ExportManager::new();219 {220 let mut add_exporter = |flag, exporttype| {219 if let Some(filename) = matches.value_of("export-asciidoc") {220 export_manager.add_exporter(ExportType::Asciidoc, filename);221 if let Some(filename) = matches.value_of(flag) {222 export_manager.add_exporter(exporttype, filename);223 }224 };225 add_exporter("export-asciidoc", ExportType::Asciidoc);226 add_exporter("export-json", ExportType::Json);227 add_exporter("export-csv", ExportType::Csv);228 add_exporter("export-markdown", ExportType::Markdown);229 }222 if let Some(filename) = matches.value_of("export-json") {223 export_manager.add_exporter(ExportType::Json, filename);224 }225 if let Some(filename) = matches.value_of("export-csv") {226 export_manager.add_exporter(ExportType::Csv, filename);227 }228 if let Some(filename) = matches.value_of("export-markdown") {229 export_manager.add_exporter(ExportType::Markdown, filename);230 }230 export_manager231}232233/// Build the commands to benchmark
22 unmodified lines