mirror of
https://github.com/OMGeeky/advisory-db.git
synced 2025-12-30 00:03:57 +01:00
Update to 'rustsec' crate v0.11
This commit is contained in:
19
Cargo.toml
19
Cargo.toml
@@ -1,19 +1,16 @@
|
||||
[package]
|
||||
name = "rustsec-advisory-db"
|
||||
name = "rustsec-advisory-db"
|
||||
description = "Security advisory database for Rust crates published through crates.io"
|
||||
version = "0.0.0"
|
||||
authors = ["Tony Arcieri <bascule@gmail.com>"]
|
||||
license-file = "LICENSE.txt"
|
||||
repository = "https://github.com/rustsec/advisory-db"
|
||||
documentation = "https://github.com/rustsec/advisory-db"
|
||||
categories = ["api-bindings", "development-tools"]
|
||||
keywords = ["rustsec", "security", "advisory", "vulnerability"]
|
||||
version = "0.0.0"
|
||||
authors = ["Tony Arcieri <bascule@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[[bin]]
|
||||
name = "rustsec-advisory-db"
|
||||
|
||||
[dependencies]
|
||||
gumdrop = "0.4"
|
||||
gumdrop_derive = "0.4"
|
||||
rustsec = "0.10"
|
||||
gumdrop = "0.5"
|
||||
gumdrop_derive = "0.5"
|
||||
rustsec = "0.11"
|
||||
crates_io_api = "0.3"
|
||||
|
||||
16
src/main.rs
16
src/main.rs
@@ -1,8 +1,4 @@
|
||||
extern crate crates_io_api;
|
||||
extern crate gumdrop;
|
||||
#[macro_use]
|
||||
extern crate gumdrop_derive;
|
||||
extern crate rustsec;
|
||||
#![allow(clippy::never_loop)]
|
||||
|
||||
use gumdrop::Options;
|
||||
use rustsec::{AdvisoryDatabase, Repository};
|
||||
@@ -93,10 +89,12 @@ fn check() {
|
||||
fn check_advisory(cratesio_client: &crates_io_api::SyncClient, advisory: &rustsec::Advisory) {
|
||||
let response = cratesio_client
|
||||
.get_crate(advisory.package.as_str())
|
||||
.expect(&format!(
|
||||
"Failed to get package from crates.io: {}",
|
||||
advisory.package.as_str()
|
||||
));
|
||||
.unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"Failed to get package from crates.io: {}",
|
||||
advisory.package.as_str()
|
||||
)
|
||||
});
|
||||
|
||||
if response.crate_data.name != advisory.package.as_str() {
|
||||
panic!(
|
||||
|
||||
Reference in New Issue
Block a user