Skip to content

Commit

Permalink
Remove parking_lot and erased-serde (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Veetaha authored May 1, 2020
1 parent 1a7904c commit 961f381
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 58 deletions.
53 changes: 0 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ clap = "2.33.0"
codespan = { version = "0.9.0", features = ["reporting"] }
codespan-reporting = "0.9.0"
crossbeam = "0.7.3"
erased-serde = "0.3.9"
fern = "0.6.0"
home = "0.5.3"
krates = "0.2.0"
log = "0.4.8"
parking_lot = "0.10.0"
rayon = "1.3.0"
regex = { version = "1.3.1", default-features = true }
semver = "0.9.0"
Expand Down
11 changes: 8 additions & 3 deletions tests/advisories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ use cargo_deny::{
diag, Krates,
};
use krates::cm::Metadata;
use std::sync::RwLock;

struct Ctx {
krates: Krates,
spans: (diag::KrateSpans, codespan::FileId),
db: advisories::Database,
lock: advisories::Lockfile,
files: parking_lot::RwLock<codespan::Files<String>>,
files: RwLock<codespan::Files<String>>,
}

fn load() -> Ctx {
Expand Down Expand Up @@ -39,14 +40,18 @@ fn load() -> Ctx {
spans,
lock,
db,
files: parking_lot::RwLock::new(files),
files: RwLock::new(files),
}
}

fn load_cfg(ctx: &Ctx, test_name: &str, cfg_str: String) -> Result<cfg::ValidConfig, Error> {
let cfg: advisories::cfg::Config = toml::from_str(&cfg_str)?;

let cfg_id = ctx.files.write().add(test_name.to_owned(), cfg_str);
let cfg_id = ctx
.files
.write()
.unwrap()
.add(test_name.to_owned(), cfg_str);

cfg.validate(cfg_id)
.map_err(|_| anyhow::anyhow!("failed to load {}", test_name))
Expand Down

0 comments on commit 961f381

Please sign in to comment.