Fix warnings

This commit is contained in:
CreepySkeleton 2020-05-31 17:53:24 +03:00
parent 12e8541678
commit 41c4d186f1
2 changed files with 7 additions and 3 deletions

View file

@ -471,7 +471,7 @@ impl<'a> From<&'a Yaml> for ArgGroup<'a> {
#[cfg(test)]
mod test {
use super::{ArgGroup, Id};
use super::ArgGroup;
#[cfg(feature = "yaml")]
use yaml_rust::YamlLoader;

View file

@ -1,9 +1,9 @@
use clap::{App, Arg};
#[cfg(debug_assertions)]
#[test]
#[should_panic = "Argument names must be unique, but 'arg1' is in use by more than one argument or group"]
fn unique_arg_names() {
use clap::{App, Arg};
let _ = App::new("some")
.args(&[Arg::new("arg1").short('a'), Arg::new("arg1").short('b')])
.try_get_matches();
@ -13,6 +13,8 @@ fn unique_arg_names() {
#[test]
#[should_panic = "Short option names must be unique for each argument, but '-a' is in use by both 'arg1' and 'arg2'"]
fn unique_arg_shorts() {
use clap::{App, Arg};
let _ = App::new("some")
.args(&[Arg::new("arg1").short('a'), Arg::new("arg2").short('a')])
.try_get_matches();
@ -22,6 +24,8 @@ fn unique_arg_shorts() {
#[test]
#[should_panic = "Long option names must be unique for each argument, but '--long' is in use by both 'arg1' and 'arg2'"]
fn unique_arg_longs() {
use clap::{App, Arg};
let _ = App::new("some")
.args(&[Arg::new("arg1").long("long"), Arg::new("arg2").long("long")])
.try_get_matches();