In particular, fix macros that take an enum of one of the the following forms:
- `#[...] enum { ... , }`
- `pub enum { ... , }`
- `enum { ... , }`
Previously, these expansions would result in an error message like "error: no
rules expected the token `:`".
Add extensive tests for each pattern. Only two of the patterns had tests
before, so these errors did not surface automatically.
If one is using a nightly Rust compiler they should compile clap
with the `nightly` feature.
```toml
[dependencies]
clap = { version = "2.27", features = ["nightly"] }
```
This isn't required for compilation to succeed, only to take
advantage of any nightly features used by clap.
If one is compiling with `#[deny(warnings)]` this commit will cause
compilation to fail if one *does not* compile with the `nightly`
since `std::ascii::AsciiExt` is no longer required in in multiple
files as of the latest Rust nightly (Nov 6th, 2017).
Closes#1095
* 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)) =>{
| ^^^^^^^^^^^^^