diff --git a/src/cargo-about/generate.rs b/src/cargo-about/generate.rs index 591bf47..886b3b4 100644 --- a/src/cargo-about/generate.rs +++ b/src/cargo-about/generate.rs @@ -256,7 +256,7 @@ struct Input<'a> { fn generate( nfos: &[licenses::KrateLicense<'_>], - resolved: &[licenses::Resolved], + resolved: &[Option], files: &licenses::resolution::Files, stream: term::termcolor::StandardStream, hbs: &Handlebars<'_>, @@ -270,7 +270,11 @@ fn generate( let licenses = { let mut licenses = BTreeMap::new(); - for (krate_license, resolved) in nfos.iter().zip(resolved.iter()) { + for (krate_license, resolved) in nfos + .iter() + .zip(resolved.iter()) + .filter_map(|(kl, res)| res.as_ref().map(|res| (kl, res))) + { if !resolved.diagnostics.is_empty() { let mut streaml = stream.lock(); diff --git a/src/licenses/resolution.rs b/src/licenses/resolution.rs index f6d4e24..7060567 100644 --- a/src/licenses/resolution.rs +++ b/src/licenses/resolution.rs @@ -56,6 +56,7 @@ impl<'acc> fmt::Display for Accepted<'acc> { } } +#[derive(Debug)] pub struct Resolved { /// The minimum license requirements that are required pub licenses: Vec, @@ -100,12 +101,12 @@ pub fn resolve( licenses: &[KrateLicense<'_>], accepted: &[Licensee], krate_cfg: &std::collections::BTreeMap, -) -> (Files, Vec) { +) -> (Files, Vec>) { let mut files = codespan::Files::new(); let resolved = licenses .iter() - .filter_map(|kl| { + .map(|kl| { let mut resolved = Resolved { licenses: Vec::new(), diagnostics: Vec::new(),