From 1d523ce8f79f6053c89051f661d09d53bd038b19 Mon Sep 17 00:00:00 2001 From: Darren Tsung Date: Thu, 21 Dec 2017 15:21:28 -0800 Subject: [PATCH 1/2] =?UTF-8?q?Add=20=E2=80=9C,=20add=20these=20lines?= =?UTF-8?q?=E2=80=9D=20as=20well=20as=20removing=20the=20extra=20space=20b?= =?UTF-8?q?etween=20the=20attributes=20to=20make=20it=20more=20clear=20tha?= =?UTF-8?q?t=20both=20should=20be=20included.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 82f1908bb237..35095ed05aa7 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,10 @@ clippy = {version = "*", optional = true} default = [] ``` -And, in your `main.rs` or `lib.rs`: +And, in your `main.rs` or `lib.rs`, add these lines: ```rust #![cfg_attr(feature="clippy", feature(plugin))] - #![cfg_attr(feature="clippy", plugin(clippy))] ``` From 203038cbe5defbe435881dbb3553413c95b1573c Mon Sep 17 00:00:00 2001 From: Darren Tsung Date: Thu, 21 Dec 2017 15:24:18 -0800 Subject: [PATCH 2/2] Add +nightly to command for running cargo build. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35095ed05aa7..3195a2851df4 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ And, in your `main.rs` or `lib.rs`, add these lines: #![cfg_attr(feature="clippy", plugin(clippy))] ``` -Then build by enabling the feature: `cargo build --features "clippy"` +Then build by enabling the feature: `cargo +nightly build --features "clippy"`. Instead of adding the `cfg_attr` attributes you can also run clippy on demand: `cargo rustc --features clippy -- -Z no-trans -Z extra-plugins=clippy`