1700: Fix warnings on nightly r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
This commit is contained in:
bors[bot] 2020-02-21 00:30:34 +00:00 committed by GitHub
commit a3b0f4825e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View file

@ -127,13 +127,11 @@ where
S: Into<String>,
T: Into<OsString>,
{
use std::error::Error;
let out_dir = PathBuf::from(out_dir.into());
let file_name = G::file_name(app.get_bin_name().unwrap());
let mut file = match File::create(out_dir.join(file_name)) {
Err(why) => panic!("couldn't create completion file: {}", why.description()),
Err(why) => panic!("couldn't create completion file: {}", why),
Ok(file) => file,
};

View file

@ -1465,7 +1465,7 @@ impl<'b> App<'b> {
}
#[cfg(not(debug_assertions))]
fn _panic_on_missing_help(app: &App, help_required_globally: bool) {}
fn _panic_on_missing_help(_app: &App, _help_required_globally: bool) {}
#[cfg(debug_assertions)]
fn _panic_on_missing_help(app: &App, help_required_globally: bool) {

View file

@ -830,11 +830,11 @@ where
let arg_allows_tac = match needs_val_of {
ParseResult::Opt(name) => {
let o = self.app.find(name).expect(INTERNAL_ERROR_MSG);
(o.is_set(ArgSettings::AllowHyphenValues) || app_wide_settings)
o.is_set(ArgSettings::AllowHyphenValues) || app_wide_settings
}
ParseResult::Pos(name) => {
let p = self.app.find(name).expect(INTERNAL_ERROR_MSG);
(p.is_set(ArgSettings::AllowHyphenValues) || app_wide_settings)
p.is_set(ArgSettings::AllowHyphenValues) || app_wide_settings
}
ParseResult::ValuesDone => return true,
_ => false,

View file

@ -427,7 +427,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> {
a,
num,
if a.is_set(ArgSettings::MultipleValues) {
(ma.vals.len() % num as usize)
ma.vals.len() % num as usize
} else {
ma.vals.len()
},