Skip to content

Commit 3edb94b

Browse files
committed
Bump clippy to latest nightly
1 parent 2411fae commit 3edb94b

File tree

12 files changed

+41
-31
lines changed

12 files changed

+41
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ matrix:
5151
- cargo build
5252
- cargo test
5353
- npm test
54-
- rust: nightly-2017-09-20
54+
- rust: nightly-2017-11-07
5555
env: CLIPPY=YESPLEASE
5656
script:
5757
- cargo check --features "lint"

Cargo.lock

Lines changed: 24 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ diesel_full_text_search = "0.16.0"
5353
serde_json = "1.0.0"
5454
serde_derive = "1.0.0"
5555
serde = "1.0.0"
56-
clippy = { version = "=0.0.162", optional = true }
56+
clippy = { version = "=0.0.169", optional = true }
5757
chrono = { version = "0.4.0", features = ["serde"] }
5858
comrak = { version = "0.2.3", default-features = false }
5959
ammonia = { git = "https://github.com/notriddle/ammonia", rev = "3d4e4073f8cdb7c60203b9036c09f4385a2fdbbd" }

src/keyword.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)] // TODO: Remove when rustc 1.23 is stable
12
use std::ascii::AsciiExt;
23

34
use chrono::NaiveDateTime;

src/krate/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn summary(req: &mut Request) -> CargoResult<Response> {
4141
.map(|versions| Version::max(versions.into_iter().map(|v| v.num)))
4242
.zip(krates)
4343
.map(|(max_version, krate)| {
44-
Ok(krate.minimal_encodable(max_version, None, false, None))
44+
Ok(krate.minimal_encodable(&max_version, None, false, None))
4545
})
4646
.collect()
4747
};
@@ -153,7 +153,7 @@ pub fn show(req: &mut Request) -> CargoResult<Response> {
153153
Ok(
154154
req.json(&R {
155155
krate: krate.clone().encodable(
156-
max_version,
156+
&max_version,
157157
Some(ids),
158158
Some(&kws),
159159
Some(&cats),

src/krate/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)] // TODO: Remove when rustc 1.23 is stable
12
use std::ascii::AsciiExt;
23

34
use chrono::{NaiveDate, NaiveDateTime};
@@ -26,7 +27,7 @@ pub mod metadata;
2627

2728
/// Hosts in this blacklist are known to not be hosting documentation,
2829
/// and are possibly of malicious intent e.g. ad tracking networks, etc.
29-
const DOCUMENTATION_BLACKLIST: [&'static str; 1] = ["rust-ci.org"];
30+
const DOCUMENTATION_BLACKLIST: [&str; 1] = ["rust-ci.org"];
3031

3132
#[derive(Debug, Insertable, Queryable, Identifiable, Associations, AsChangeset, Clone, Copy)]
3233
#[belongs_to(Crate)]
@@ -315,7 +316,7 @@ impl Crate {
315316

316317
pub fn minimal_encodable(
317318
self,
318-
max_version: semver::Version,
319+
max_version: &semver::Version,
319320
badges: Option<Vec<Badge>>,
320321
exact_match: bool,
321322
recent_downloads: Option<i64>,
@@ -334,7 +335,7 @@ impl Crate {
334335
#[cfg_attr(feature = "clippy", allow(too_many_arguments))]
335336
pub fn encodable(
336337
self,
337-
max_version: semver::Version,
338+
max_version: &semver::Version,
338339
versions: Option<Vec<i32>>,
339340
keywords: Option<&[Keyword]>,
340341
categories: Option<&[Category]>,

src/krate/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ pub fn publish(req: &mut Request) -> CargoResult<Response> {
181181
warnings: Warnings<'a>,
182182
}
183183
Ok(req.json(&R {
184-
krate: krate.minimal_encodable(max_version, None, false, None),
184+
krate: krate.minimal_encodable(&max_version, None, false, None),
185185
warnings: warnings,
186186
}))
187187
})

src/krate/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub fn search(req: &mut Request) -> CargoResult<Response> {
201201
.filter(badges::crate_id.eq(krate.id))
202202
.load::<Badge>(&*conn)?;
203203
Ok(krate.minimal_encodable(
204-
max_version,
204+
&max_version,
205205
Some(badges),
206206
perfect_match,
207207
Some(recent_downloads),

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! This crate implements the backend server for https://crates.io/
1+
//! This crate implements the backend server for <https://crates.io/>
22
//!
33
//! All implemented routes are defined in the [middleware](fn.middleware.html) function and
44
//! implemented in the [category](category/index.html), [keyword](keyword/index.html),

src/uploaders.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl Uploader {
191191
}
192192

193193
/// Deletes an uploaded file.
194-
fn delete(&self, app: Arc<App>, path: &str) -> CargoResult<()> {
194+
fn delete(&self, app: &Arc<App>, path: &str) -> CargoResult<()> {
195195
match *self {
196196
Uploader::S3 { ref bucket, .. } => {
197197
let mut handle = app.handle();
@@ -217,7 +217,7 @@ pub struct Bomb {
217217
impl Drop for Bomb {
218218
fn drop(&mut self) {
219219
if let Some(ref path) = self.path {
220-
if let Err(e) = self.app.config.uploader.delete(Arc::clone(&self.app), path) {
220+
if let Err(e) = self.app.config.uploader.delete(&self.app, path) {
221221
println!("unable to delete {}, {:?}", path, e);
222222
}
223223
}

src/user/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl User {
243243
/// This route will return an authorization URL for the GitHub OAuth flow including the crates.io
244244
/// `client_id` and a randomly generated `state` secret.
245245
///
246-
/// see https://developer.github.com/v3/oauth/#redirect-users-to-request-github-access
246+
/// see <https://developer.github.com/v3/oauth/#redirect-users-to-request-github-access>
247247
///
248248
/// ## Response Body Example
249249
///
@@ -279,7 +279,7 @@ pub fn github_authorize(req: &mut Request) -> CargoResult<Response> {
279279
/// to exchange the temporary `code` for an API token. The API token is returned together with
280280
/// the corresponding user information.
281281
///
282-
/// see https://developer.github.com/v3/oauth/#github-redirects-back-to-your-site
282+
/// see <https://developer.github.com/v3/oauth/#github-redirects-back-to-your-site>
283283
///
284284
/// ## Query Parameters
285285
///

src/util/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub fn human<S: ToString + ?Sized>(error: &S) -> Box<CargoError> {
342342

343343
/// This is intended to be used for errors being sent back to the Ember
344344
/// frontend, not to cargo as cargo does not handle non-200 response codes well
345-
/// (see https://github.com/rust-lang/cargo/issues/3995), but Ember requires
345+
/// (see <https://github.com/rust-lang/cargo/issues/3995>), but Ember requires
346346
/// non-200 response codes for its stores to work properly.
347347
///
348348
/// Since this is going back to the UI these errors are treated the same as

0 commit comments

Comments
 (0)