From 451b2c30ad034d6bed397c786050bdbfb3b03a7e Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 16 Jul 2017 21:50:03 -0600 Subject: [PATCH] Enable clippy linting. --- Cargo.toml | 4 +++- src/lib.rs | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 527b14e..3d517d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,9 @@ repository = "https://github.com/ebfull/pairing" [dependencies] rand = "0.3" -byteorder = "1.1" +byteorder = "1.1.0" +clippy = { version = "0.0.144", optional = true } [features] unstable-wnaf = [] +unstable-features = ["unstable-wnaf"] diff --git a/src/lib.rs b/src/lib.rs index 210da01..b3df2a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,17 @@ +// This library relies on the Rust nightly compiler's `i128_type` feature. #![feature(i128_type)] +// `clippy` is a code linting tool for improving code quality by catching +// common mistakes or strange code patterns. If the `clippy` feature is +// provided, it is enabled and all compiler warnings are prohibited. +#![cfg_attr(feature = "clippy", deny(warnings))] +#![cfg_attr(feature = "clippy", feature(plugin))] +#![cfg_attr(feature = "clippy", plugin(clippy))] +#![cfg_attr(feature = "clippy", allow(inline_always))] +#![cfg_attr(feature = "clippy", allow(too_many_arguments))] + +// The compiler provides `test` (on nightly) for benchmarking tools, but +// it's hidden behind a feature flag. Enable it if we're testing. #![cfg_attr(test, feature(test))] #[cfg(test)] extern crate test;