]>
git.proxmox.com Git - rustc.git/blob - vendor/structopt/tests/deny-warnings.rs
1 // Copyright 2018 Guillaume Pinot (@TeXitoi) <texitoi@texitoi.eu>
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6 // option. This file may not be copied, modified, or distributed
7 // except according to those terms.
11 use structopt
::StructOpt
;
13 fn try_str(s
: &str) -> Result
<String
, std
::convert
::Infallible
> {
18 fn warning_never_struct() {
19 #[derive(Debug, PartialEq, StructOpt)]
21 #[structopt(parse(try_from_str = try_str))]
28 Opt
::from_iter(&["test", "foo"])
33 fn warning_never_enum() {
34 #[derive(Debug, PartialEq, StructOpt)]
37 #[structopt(parse(try_from_str = try_str))]
45 Opt
::from_iter(&["test", "foo", "foo"])