Skip to content

Commit 4b5b9c4

Browse files
committed
Make clippy happy
1 parent 4641f9d commit 4b5b9c4

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/background/registry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::new_without_default_derive)] // https://github.com/rust-lang/rust-clippy/issues/3632
2+
13
use serde_json;
24
use std::collections::HashMap;
35
use std::panic::RefUnwindSafe;

src/background/runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<Env: RefUnwindSafe + Send + Sync + 'static> Runner<Env> {
9090
let job_id = job.id;
9191

9292
let result = catch_unwind(|| f(job))
93-
.map_err(try_to_extract_panic_info)
93+
.map_err(|e| try_to_extract_panic_info(&e))
9494
.and_then(|r| r);
9595

9696
match result {
@@ -129,7 +129,7 @@ impl<Env: RefUnwindSafe + Send + Sync + 'static> Runner<Env> {
129129
/// However, the `panic::set_hook` functions deal with a `PanicInfo` type, and its payload is
130130
/// documented as "commonly but not always `&'static str` or `String`". So we can try all of those,
131131
/// and give up if we didn't get one of those three types.
132-
fn try_to_extract_panic_info(info: Box<dyn Any + Send + 'static>) -> Box<dyn CargoError> {
132+
fn try_to_extract_panic_info(info: &(dyn Any + Send + 'static)) -> Box<dyn CargoError> {
133133
if let Some(x) = info.downcast_ref::<PanicInfo>() {
134134
internal(&format_args!("job panicked: {}", x))
135135
} else if let Some(x) = info.downcast_ref::<&'static str>() {

src/controllers/version/yank.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn modify_yank(req: &mut dyn Request, yanked: bool) -> CargoResult<Response> {
4343
diesel::update(&version)
4444
.set(versions::yanked.eq(yanked))
4545
.execute(&*conn)?;
46-
git::yank(&conn, krate.name, version.num, yanked)?;
46+
git::yank(&conn, krate.name, &version.num, yanked)?;
4747
Ok(())
4848
})?;
4949
}

src/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl Job for Yank {
203203
pub fn yank(
204204
conn: &PgConnection,
205205
krate: String,
206-
version: semver::Version,
206+
version: &semver::Version,
207207
yanked: bool,
208208
) -> CargoResult<()> {
209209
Yank {

0 commit comments

Comments
 (0)