Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrif committed Feb 12, 2019
1 parent 0b4af66 commit 65539fd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/background/registry.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::new_without_default_derive)] // https://github.com/rust-lang/rust-clippy/issues/3632

use serde_json;
use std::collections::HashMap;
use std::panic::RefUnwindSafe;
Expand Down
4 changes: 2 additions & 2 deletions src/background/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<Env: RefUnwindSafe + Send + Sync + 'static> Runner<Env> {
let job_id = job.id;

let result = catch_unwind(|| f(job))
.map_err(try_to_extract_panic_info)
.map_err(|e| try_to_extract_panic_info(&e))
.and_then(|r| r);

match result {
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<Env: RefUnwindSafe + Send + Sync + 'static> Runner<Env> {
/// However, the `panic::set_hook` functions deal with a `PanicInfo` type, and its payload is
/// documented as "commonly but not always `&'static str` or `String`". So we can try all of those,
/// and give up if we didn't get one of those three types.
fn try_to_extract_panic_info(info: Box<dyn Any + Send + 'static>) -> Box<dyn CargoError> {
fn try_to_extract_panic_info(info: &(dyn Any + Send + 'static)) -> Box<dyn CargoError> {
if let Some(x) = info.downcast_ref::<PanicInfo>() {
internal(&format_args!("job panicked: {}", x))
} else if let Some(x) = info.downcast_ref::<&'static str>() {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/version/yank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn modify_yank(req: &mut dyn Request, yanked: bool) -> CargoResult<Response> {
diesel::update(&version)
.set(versions::yanked.eq(yanked))
.execute(&*conn)?;
git::yank(&conn, krate.name, version.num, yanked)?;
git::yank(&conn, krate.name, &version.num, yanked)?;
Ok(())
})?;
}
Expand Down
2 changes: 1 addition & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Job for Yank {
pub fn yank(
conn: &PgConnection,
krate: String,
version: semver::Version,
version: &semver::Version,
yanked: bool,
) -> CargoResult<()> {
Yank {
Expand Down

0 comments on commit 65539fd

Please sign in to comment.