summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Unterwaditzer <markus@unterwaditzer.net>2016-02-20 19:48:22 +0100
committerMarkus Unterwaditzer <markus@unterwaditzer.net>2016-02-20 19:48:22 +0100
commit37b60e25ceef2e7a5f596879932372fdfd7b4cf4 (patch)
tree812b6e5fe83799613a3d0dac3ef35e952ddd3635
parent8d4971ef24b34d67ac91152aa6048de1d75362b6 (diff)
Introduce clippy
-rw-r--r--Cargo.toml3
-rw-r--r--Makefile3
-rw-r--r--src/vobject/lib.rs5
3 files changed, 11 insertions, 0 deletions
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 '<!doctype html><title>rust-vobject</title><meta http-equiv="refresh" content="0; ./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;