mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
Merge #1700
1700: Fix warnings on nightly r=pksunkara a=CreepySkeleton Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
This commit is contained in:
commit
a3b0f4825e
4 changed files with 5 additions and 7 deletions
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue