Fix compilation warnings (#825)

* tests: remove unnecessary mut

When building the projec, I was told

    warning: variable does not need to be mutable, #[warn(unused_mut)]
    on by default
      --> tests/macros.rs:39:9
       |
    39 |     let mut app = clap_app!(("app name with spaces-and-hyphens") =>
       |         ^^^^^^^

* examples: remove unused variable

The inner Some value is not used in the match arm:

    warning: unused variable: `local_matches`,
    #[warn(unused_variables)] on by default
       --> examples/20_subcommands.rs:128:32
        |
    128 |                 ("local", Some(local_matches)) =>{
        |                                ^^^^^^^^^^^^^
This commit is contained in:
Martin Geisler 2017-01-30 10:13:49 +08:00 committed by Kevin K
parent 5b29be9b07
commit d6743bb70d
2 changed files with 2 additions and 3 deletions

View file

@ -125,8 +125,7 @@ fn main() {
// Now we have a reference to remote's matches // Now we have a reference to remote's matches
println!("Pushing to {}", remote_matches.value_of("repo").unwrap()); println!("Pushing to {}", remote_matches.value_of("repo").unwrap());
}, },
("local", Some(local_matches)) =>{ ("local", Some(_)) =>{
// Now we have a reference to push's matches
println!("'git push local' was used"); println!("'git push local' was used");
}, },
_ => unreachable!(), _ => unreachable!(),

View file

@ -36,7 +36,7 @@ fn basic() {
#[test] #[test]
fn quoted_app_name() { fn quoted_app_name() {
let mut app = clap_app!(("app name with spaces-and-hyphens") => let app = clap_app!(("app name with spaces-and-hyphens") =>
(version: "0.1") (version: "0.1")
(about: "tests clap library") (about: "tests clap library")
(author: "Kevin K. <kbknapp@gmail.com>") (author: "Kevin K. <kbknapp@gmail.com>")