1745: Fix CI r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
This commit is contained in:
bors[bot] 2020-03-13 20:28:29 +00:00 committed by GitHub
commit 9c8f9e20b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 13 deletions

View file

@ -14,7 +14,7 @@ stages:
jobs: jobs:
- job: - job:
variables: variables:
rust: 1.36.0 rust: 1.40.0
strategy: strategy:
matrix: matrix:
Windows 32-bit (MSVC): Windows 32-bit (MSVC):

View file

@ -30,8 +30,8 @@ jobs:
fast_finish: true fast_finish: true
include: include:
- os: osx - os: osx
rust: 1.36.0 rust: 1.40.0
- rust: 1.36.0 - rust: 1.40.0
- {} - {}
- rust: beta - rust: beta
- rust: nightly - rust: nightly

View file

@ -5,7 +5,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
#[rustversion::attr(any(not(stable), before(1.39)), ignore)] #[rustversion::attr(any(not(stable), before(1.42)), ignore)]
#[test] #[test]
fn ui() { fn ui() {
let t = trybuild::TestCases::new(); let t = trybuild::TestCases::new();

View file

@ -1,4 +1,4 @@
error[E0599]: no method named `non_existing_attribute` found for type `clap::build::arg::Arg<'_>` in the current scope error[E0599]: no method named `non_existing_attribute` found for struct `clap::build::arg::Arg<'_>` in the current scope
--> $DIR/non_existent_attr.rs:14:19 --> $DIR/non_existent_attr.rs:14:19
| |
14 | #[clap(short, non_existing_attribute = 1)] 14 | #[clap(short, non_existing_attribute = 1)]

View file

@ -4,7 +4,7 @@ error: `#[derive(Clap)]` only supports non-tuple structs and enums
11 | #[derive(Clap, Debug)] 11 | #[derive(Clap, Debug)]
| ^^^^ | ^^^^
error[E0599]: no function or associated item named `parse` found for type `Opt` in the current scope error[E0599]: no function or associated item named `parse` found for struct `Opt` in the current scope
--> $DIR/tuple_struct.rs:16:20 --> $DIR/tuple_struct.rs:16:20
| |
13 | struct Opt(u32); 13 | struct Opt(u32);

View file

@ -146,7 +146,7 @@ impl<'b> App<'b> {
/// Get the name of the binary /// Get the name of the binary
pub fn get_bin_name(&self) -> Option<&str> { pub fn get_bin_name(&self) -> Option<&str> {
self.bin_name.as_ref().map(String::as_str) self.bin_name.as_deref()
} }
/// Sets a string of author(s) that will be displayed to the user when they /// Sets a string of author(s) that will be displayed to the user when they
@ -1957,7 +1957,7 @@ impl<'a> From<&'a Yaml> for App<'a> {
App::new(name) App::new(name)
} else { } else {
let yaml_hash = yaml.as_hash().unwrap(); let yaml_hash = yaml.as_hash().unwrap();
let sc_key = yaml_hash.keys().nth(0).unwrap(); let sc_key = yaml_hash.keys().next().unwrap();
is_sc = Some(yaml_hash.get(sc_key).unwrap()); is_sc = Some(yaml_hash.get(sc_key).unwrap());
App::new(sc_key.as_str().unwrap()) App::new(sc_key.as_str().unwrap())
}; };

View file

@ -171,7 +171,7 @@ impl<'help> Arg<'help> {
#[allow(clippy::cognitive_complexity)] #[allow(clippy::cognitive_complexity)]
pub fn from_yaml(y: &yaml_rust::yaml::Hash) -> Arg { pub fn from_yaml(y: &yaml_rust::yaml::Hash) -> Arg {
// We WANT this to panic on error...so expect() is good. // We WANT this to panic on error...so expect() is good.
let name_yml = y.keys().nth(0).unwrap(); let name_yml = y.keys().next().unwrap();
let name_str = name_yml.as_str().unwrap(); let name_str = name_yml.as_str().unwrap();
let mut a = Arg::with_name(name_str); let mut a = Arg::with_name(name_str);
let arg_settings = y.get(name_yml).unwrap().as_hash().unwrap(); let arg_settings = y.get(name_yml).unwrap().as_hash().unwrap();
@ -817,7 +817,7 @@ impl<'help> Arg<'help> {
/// assert!(res.is_err()); /// assert!(res.is_err());
/// assert_eq!(res.unwrap_err().kind, ErrorKind::ArgumentConflict); /// assert_eq!(res.unwrap_err().kind, ErrorKind::ArgumentConflict);
/// ``` /// ```
/// ///
/// [`Arg::conflicts_with_all(names)`]: ./struct.Arg.html#method.conflicts_with_all /// [`Arg::conflicts_with_all(names)`]: ./struct.Arg.html#method.conflicts_with_all
/// [`Arg::exclusive(true)`]: ./struct.Arg.html#method.exclusive /// [`Arg::exclusive(true)`]: ./struct.Arg.html#method.exclusive
@ -2115,7 +2115,7 @@ impl<'help> Arg<'help> {
self.setb(ArgSettings::UseValueDelimiter); self.setb(ArgSettings::UseValueDelimiter);
self.val_delim = Some( self.val_delim = Some(
d.chars() d.chars()
.nth(0) .next()
.expect("Failed to get value_delimiter from arg"), .expect("Failed to get value_delimiter from arg"),
); );
self self

View file

@ -469,7 +469,7 @@ impl<'a> From<&'a yaml_rust::yaml::Hash> for ArgGroup<'a> {
// We WANT this to panic on error...so expect() is good. // We WANT this to panic on error...so expect() is good.
let mut a = ArgGroup::default(); let mut a = ArgGroup::default();
let group_settings = if b.len() == 1 { let group_settings = if b.len() == 1 {
let name_yml = b.keys().nth(0).expect("failed to get name"); let name_yml = b.keys().next().expect("failed to get name");
let name_str = name_yml let name_str = name_yml
.as_str() .as_str()
.expect("failed to convert arg YAML name to str"); .expect("failed to convert arg YAML name to str");

View file

@ -759,7 +759,7 @@ macro_rules! clap_app {
$crate::clap_app!{ @arg ($arg.long(stringify!($long))) $modes $($tail)* } $crate::clap_app!{ @arg ($arg.long(stringify!($long))) $modes $($tail)* }
}; };
(@arg ($arg:expr) $modes:tt -$short:ident $($tail:tt)*) => { (@arg ($arg:expr) $modes:tt -$short:ident $($tail:tt)*) => {
$crate::clap_app!{ @arg ($arg.short(stringify!($short).chars().nth(0).unwrap())) $modes $($tail)* } $crate::clap_app!{ @arg ($arg.short(stringify!($short).chars().next().unwrap())) $modes $($tail)* }
}; };
(@arg ($arg:expr) (-) <$var:ident> $($tail:tt)*) => { (@arg ($arg:expr) (-) <$var:ident> $($tail:tt)*) => {
$crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value +required $($tail)* } $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value +required $($tail)* }