Avoid copyright notice for MPL2-licensed dependencies

The license does not include a copyright notice
This commit is contained in:
Magnus Hoff 2017-11-14 16:14:28 +01:00
parent 334b17ae56
commit b2e8b45100

View file

@ -18,6 +18,16 @@ pub enum LicenseId {
Ofl11,
}
impl LicenseId {
fn include_notice(&self) -> bool {
use self::LicenseId::*;
match self {
&Mpl2 => false,
_ => true,
}
}
}
impl quote::ToTokens for LicenseId {
fn to_tokens(&self, tokens: &mut quote::Tokens) {
use self::LicenseId::*;
@ -54,6 +64,11 @@ impl quote::ToTokens for LicenseReport {
&None => quote! { None },
};
let copyright = match license.include_notice() {
true => copyright,
false => "",
};
tokens.append(quote! {
LicenseInfo {
name: #name,