Fix warning when clippy not enabled
This commit is contained in:
parent
ce2d166de2
commit
705d280f8b
2 changed files with 10 additions and 10 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
|
@ -4,7 +4,7 @@ version = "0.14.0"
|
|||
dependencies = [
|
||||
"bit-vec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clippy 0.0.114 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crc 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -73,7 +73,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "2.20.3"
|
||||
version = "2.20.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -526,7 +526,7 @@ dependencies = [
|
|||
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
|
||||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8"
|
||||
"checksum cargo_metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "34fdab49a2904acb112c83b62f0118de3de3ce28e52a9188dec2858e43878f25"
|
||||
"checksum clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f89819450aa94325998aa83ce7ea142db11ad24c725d6bc48459845e0d6d9f18"
|
||||
"checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758"
|
||||
"checksum clippy 0.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "808f9027f62dda9f764f26542a10465a6db221a5bd57981a63a2f84a6518b098"
|
||||
"checksum clippy_lints 0.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d58f7fdb30f25e6c4dac79d0156bec6fb69834ba270dc2dc2e12754cebef75"
|
||||
"checksum crc 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc1914fae6f18ae347320f0ba5e4fc270e17c037ea621fe41ec7e8adf67d11b0"
|
||||
|
|
|
|||
14
src/main.rs
14
src/main.rs
|
|
@ -1,9 +1,9 @@
|
|||
#![cfg_attr(feature="dev", feature(plugin))]
|
||||
#![cfg_attr(feature="dev", plugin(clippy))]
|
||||
#![cfg_attr(feature="dev", warn(enum_glob_use))]
|
||||
#![cfg_attr(feature="dev", warn(if_not_else))]
|
||||
#![cfg_attr(feature="dev", warn(string_add))]
|
||||
#![cfg_attr(feature="dev", warn(string_add_assign))]
|
||||
#![cfg_attr(feature="clippy", feature(plugin))]
|
||||
#![cfg_attr(feature="clippy", plugin(clippy))]
|
||||
#![cfg_attr(feature="clippy", warn(enum_glob_use))]
|
||||
#![cfg_attr(feature="clippy", warn(if_not_else))]
|
||||
#![cfg_attr(feature="clippy", warn(string_add))]
|
||||
#![cfg_attr(feature="clippy", warn(string_add_assign))]
|
||||
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]
|
||||
#![deny(missing_debug_implementations, missing_copy_implementations)]
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ fn handle_optimization(inputs: Vec<PathBuf>, opts: Options) {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(cyclomatic_complexity)]
|
||||
#[cfg_attr(feature="clippy", allow(cyclomatic_complexity))]
|
||||
fn parse_opts_into_struct(matches: &ArgMatches) -> Result<Options, String> {
|
||||
let mut opts = if let Some(x) = matches.value_of("optimization") {
|
||||
if let Ok(opt) = x.parse::<u8>() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue