diff options
author | Leonardo Yvens <leoyvens@gmail.com> | 2016-12-23 17:53:35 -0200 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-12-23 14:53:35 -0500 |
commit | dd5ded2f78145755208043db1027cdb85ac9fd5a (patch) | |
tree | 4a4541ba35332fb7e9af9d7b26ec17bf3602b2cc /src/args.rs | |
parent | cbacf4f19ea3a73f04070d942b217b333cf88e67 (diff) |
fix some clippy lints (#288)
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/args.rs b/src/args.rs index 77421c4b..b999d493 100644 --- a/src/args.rs +++ b/src/args.rs @@ -26,7 +26,7 @@ use worker::{Worker, WorkerBuilder}; use {Result, version}; -/// Args are transformed/normalized from ArgMatches. +/// `Args` are transformed/normalized from `ArgMatches`. #[derive(Debug)] pub struct Args { paths: Vec<PathBuf>, @@ -80,12 +80,12 @@ impl Args { let matches = app::app_short().get_matches(); if matches.is_present("help-short") { let _ = ::app::app_short().print_help(); - let _ = println!(""); + println!(""); process::exit(0); } if matches.is_present("help") { let _ = ::app::app_long().print_help(); - let _ = println!(""); + println!(""); process::exit(0); } if matches.is_present("version") { @@ -264,7 +264,7 @@ impl Args { } } -/// ArgMatches wraps clap::ArgMatches and provides semantic meaning to several +/// `ArgMatches` wraps `clap::ArgMatches` and provides semantic meaning to several /// options/flags. struct ArgMatches<'a>(clap::ArgMatches<'a>); @@ -723,7 +723,7 @@ impl<'a> ArgMatches<'a> { /// Like values_of_lossy, but returns an empty vec if the flag is not /// present. fn values_of_lossy_vec(&self, name: &str) -> Vec<String> { - self.values_of_lossy(name).unwrap_or(vec![]) + self.values_of_lossy(name).unwrap_or_else(Vec::new) } /// Safely reads an arg value with the given name, and if it's present, |