Skip to content

Commit 5f79c79

Browse files
committed
Switch to the new tool attribute syntax
1 parent 19e1c14 commit 5f79c79

File tree

8 files changed

+9
-8
lines changed

8 files changed

+9
-8
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ matrix:
5454
- rustup component add clippy-preview
5555
script:
5656
- cargo fmt -- --check
57-
# TODO: Once clippy:: lint syntax is stable, remove everything after the -- below
58-
- cargo clippy --all-targets -- -A renamed_and_removed_lints
57+
- cargo clippy --all-targets --all-features --all
5958
- cargo build
6059
- cargo test
6160
- npm install

src/models/krate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl Crate {
306306
)
307307
}
308308

309-
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
309+
#[allow(clippy::too_many_arguments)]
310310
pub fn encodable(
311311
self,
312312
max_version: &semver::Version,

src/models/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ impl Version {
114114
}
115115

116116
impl NewVersion {
117+
#[allow(clippy::new_ret_no_self)]
117118
pub fn new(
118119
crate_id: i32,
119120
num: &semver::Version,

src/tests/all.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#![deny(warnings)]
22
#![allow(unknown_lints, proc_macro_derive_resolution_fallback)] // TODO: This can be removed after diesel-1.4
33

4-
// Several test methods trip this clippy lint
5-
#![cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))]
6-
74
extern crate cargo_registry;
85
extern crate chrono;
96
extern crate conduit;

src/tests/category.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ fn show() {
7373
}
7474

7575
#[test]
76+
#[allow(clippy::cyclomatic_complexity)]
7677
fn update_crate() {
7778
let (_b, app, middle) = app();
7879
let mut req = req(Method::Get, "/api/v1/categories/foo");

src/tests/krate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ fn index() {
104104
}
105105

106106
#[test]
107+
#[allow(clippy::cyclomatic_complexity)]
107108
fn index_queries() {
108109
let (app, anon, user) = TestApp::init().with_user();
109110
let user = user.as_model();
@@ -324,6 +325,7 @@ fn index_sorting() {
324325
}
325326

326327
#[test]
328+
#[allow(clippy::cyclomatic_complexity)]
327329
fn exact_match_on_queries_with_sort() {
328330
let (app, anon, user) = TestApp::init().with_user();
329331
let user = user.as_model();
@@ -1368,6 +1370,7 @@ fn yank_not_owner() {
13681370
}
13691371

13701372
#[test]
1373+
#[allow(clippy::cyclomatic_complexity)]
13711374
fn yank_max_version() {
13721375
let (_, anon, _, token) = TestApp::with_proxy().with_token();
13731376

src/tests/record.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use new_user;
3232
pub struct Bomb {
3333
iorx: Sink,
3434
quittx: Option<oneshot::Sender<()>>,
35-
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
35+
#[allow(clippy::type_complexity)]
3636
thread: Option<thread::JoinHandle<Option<(Vec<u8>, PathBuf)>>>,
3737
}
3838

src/util/request_helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ use conduit::Request;
1313
pub fn request_header<'a>(req: &'a dyn Request, header_name: &str) -> &'a str {
1414
req.headers()
1515
.find(header_name)
16-
.and_then(|x| x.first().map(|&s| s))
16+
.and_then(|x| x.first().cloned())
1717
.unwrap_or_default()
1818
}

0 commit comments

Comments
 (0)