From 37b60e25ceef2e7a5f596879932372fdfd7b4cf4 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sat, 20 Feb 2016 19:48:22 +0100 Subject: Introduce clippy --- Cargo.toml | 3 +++ Makefile | 3 +++ src/vobject/lib.rs | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 35ea7dc..989a3f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,3 +15,6 @@ license = "MIT" [lib] name = "vobject" path = "src/vobject/lib.rs" + +[dependencies] +clippy = {git = "https://github.com/Manishearth/rust-clippy", version = "*", optional = true} diff --git a/Makefile b/Makefile index 59eb1b0..33b1c67 100644 --- a/Makefile +++ b/Makefile @@ -24,3 +24,6 @@ upload: echo 'rust-vobject' \ > ./target/doc/index.htm rsync -av --chmod=755 ./target/doc/ untispace:~/virtual/rust-vobject.unterwaditzer.net/ + +clippy: + cargo build --features=clippy diff --git a/src/vobject/lib.rs b/src/vobject/lib.rs index 04ce8e3..01cb2fd 100644 --- a/src/vobject/lib.rs +++ b/src/vobject/lib.rs @@ -1,5 +1,10 @@ // DOCS +#![cfg_attr(feature = "clippy", allow(unstable_features))] +#![cfg_attr(feature = "clippy", feature(plugin))] +#![cfg_attr(feature = "clippy", plugin(clippy))] +#![cfg_attr(feature = "clippy", deny(warnings))] + use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::borrow::ToOwned; -- cgit v1.2.3