Skip to content
Myr

Fix clippy warnings

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

authored by rhysd · committed by David Peter · parent 1b7d139 · Browse files · 3 files+6 added−4 removed
This commit

State

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

Diff stats

3 files+6 added−4 removed

  • other:+6 added−4 removed

3 files+6 added−4 removed

modified:src/export/mod.rs+4 added-2 removed
44 unmodified lines
45pub struct ExportManager {46 exporters: Vec<ExporterWithFilename>,47}4849impl ExportManager {49impl Default for ExportManager {50 /// Create a new ExportManager51 pub fn new() -> ExportManager {51 fn default() -> ExportManager {52 ExportManager {53 exporters: Vec::new(),54 }55 }56}5758impl ExportManager {59 /// Add an additional exporter to the ExportManager60 pub fn add_exporter(&mut self, export_type: ExportType, filename: &str) -> Result<()> {61 let _ = File::create(filename)?;62
29 unmodified lines
modified:src/main.rs+1 added-1 removed
247 unmodified lines
248249/// Build the ExportManager that will export the results specified250/// in the given ArgMatches251fn build_export_manager(matches: &ArgMatches<'_>) -> io::Result<ExportManager> {252 let mut export_manager = ExportManager::new();252 let mut export_manager = ExportManager::default();253 {254 let mut add_exporter = |flag, exporttype| -> io::Result<()> {255 if let Some(filename) = matches.value_of(flag) {256 export_manager.add_exporter(exporttype, filename)?;
203 unmodified lines
modified:src/options.rs+1 added-1 removed
35 unmodified lines
3637impl Shell {38 /// Parse given string as shell command line39 pub fn parse<'a>(s: &str) -> Result<Self, OptionsError<'a>> {40 let v = shell_words::split(s.as_ref()).map_err(OptionsError::ShellParseError)?;40 let v = shell_words::split(s).map_err(OptionsError::ShellParseError)?;41 if v.is_empty() || v[0].is_empty() {42 return Err(OptionsError::EmptyShell);43 }44 Ok(Shell::Custom(v))
158 unmodified lines