Skip to content
Myr

Prevent creation of file named '-'

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

authored by David Peter · committed by David Peter · parent 5924ac3 · Browse files · 1 file+2 added−3 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+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:src/export/mod.rs+2 added-3 removed
77 unmodified lines
78 }7980 /// Add an additional exporter to the ExportManager81 pub fn add_exporter(&mut self, export_type: ExportType, filename: &str) -> Result<()> {82 let _ = File::create(filename)83 .with_context(|| format!("Could not create export file '{}'", filename))?;8482 let exporter: Box<dyn Exporter> = match export_type {83 ExportType::Asciidoc => Box::new(AsciidocExporter::default()),84 ExportType::Csv => Box::new(CsvExporter::default()),85 ExportType::Json => Box::new(JsonExporter::default()),
9 unmodified lines
95 } else {96 "/dev/stdout".to_string()97 }98 } else {99 let _ = File::create(filename)100 .with_context(|| format!("Could not create export file '{}'", filename))?;101 filename.to_string()102 },103 });104
19 unmodified lines