Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Sep 23, 2022
1 parent 7d7594a commit b1b629f
Show file tree
Hide file tree
Showing 17 changed files with 557 additions and 497 deletions.
8 changes: 3 additions & 5 deletions Cargo.lock

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

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ path = "src/cargo-deny/main.rs"
default = ["vendored-openssl"]
# Allows the use of a vendored version openssl when compiling libgit, which allows
# us to compile static executables (eg musl) and avoid system dependencies
vendored-openssl = ["cargo?/vendored-openssl", "crates-index/vendored-openssl", "git2/vendored-openssl"]
vendored-openssl = [
"cargo?/vendored-openssl",
"crates-index/vendored-openssl",
"git2/vendored-openssl",
]
# Allows embedding cargo as a library so that we can run in minimal (eg container)
# environments that don't need to have cargo/rust installed on them for cargo-deny
# to still function
Expand Down Expand Up @@ -65,7 +69,7 @@ git2 = "0.14"
# We need to figure out HOME/CARGO_HOME in some cases
home = "0.5"
# Provides graphs on top of cargo_metadata
krates = { version = "0.10", features = ["targets"] }
krates = { version = "0.11", features = ["targets"] }
# Log macros
log = "0.4"
# Moar brrrr
Expand Down Expand Up @@ -96,3 +100,6 @@ url = "2.1"
[dev-dependencies]
# We use this for creating fake crate directories for crawling license files on disk
tempfile = "3.1.0"

[patch.crates-io]
krates = { path = "../krates" }
4 changes: 3 additions & 1 deletion examples/11_feature_bans/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ version = "0.1.0"
edition = "2021"

[dependencies]
reqwest = { version = "=0.11.11", default-features = false, features = ["rustls-tls-webpki-roots"] }
reqwest = { version = "=0.11.11", default-features = false, features = [
"rustls-tls-webpki-roots",
] }

[features]
foo = []
9 changes: 1 addition & 8 deletions examples/11_feature_bans/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}

10 changes: 5 additions & 5 deletions src/advisories/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,19 +661,19 @@ impl PrunedLockfile {
#[inline]
pub(crate) fn krate_for_pkg<'a>(
krates: &'a Krates,
pkg: &rustsec::package::Package,
pkg: &'a rustsec::package::Package,
) -> Option<(krates::NodeId, &'a Krate)> {
krates
.krates_by_name(pkg.name.as_str())
.find(|(_, kn)| {
pkg.version == kn.krate.version
&& match (&pkg.source, &kn.krate.source) {
.find(|(_, krate)| {
pkg.version == krate.version
&& match (&pkg.source, &krate.source) {
(Some(psrc), Some(ksrc)) => psrc == ksrc,
(None, None) => true,
_ => false,
}
})
.map(|(ind, krate)| (ind, &krate.krate))
.map(|(ind, krate)| (ind, krate))
}

pub use rustsec::warning::{Kind, Warning};
Expand Down

0 comments on commit b1b629f

Please sign in to comment.