Avoid copyright notice for MPL2-licensed dependencies
The license does not include a copyright notice
This commit is contained in:
parent
334b17ae56
commit
b2e8b45100
1 changed files with 15 additions and 0 deletions
|
@ -18,6 +18,16 @@ pub enum LicenseId {
|
||||||
Ofl11,
|
Ofl11,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl LicenseId {
|
||||||
|
fn include_notice(&self) -> bool {
|
||||||
|
use self::LicenseId::*;
|
||||||
|
match self {
|
||||||
|
&Mpl2 => false,
|
||||||
|
_ => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl quote::ToTokens for LicenseId {
|
impl quote::ToTokens for LicenseId {
|
||||||
fn to_tokens(&self, tokens: &mut quote::Tokens) {
|
fn to_tokens(&self, tokens: &mut quote::Tokens) {
|
||||||
use self::LicenseId::*;
|
use self::LicenseId::*;
|
||||||
|
@ -54,6 +64,11 @@ impl quote::ToTokens for LicenseReport {
|
||||||
&None => quote! { None },
|
&None => quote! { None },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let copyright = match license.include_notice() {
|
||||||
|
true => copyright,
|
||||||
|
false => "",
|
||||||
|
};
|
||||||
|
|
||||||
tokens.append(quote! {
|
tokens.append(quote! {
|
||||||
LicenseInfo {
|
LicenseInfo {
|
||||||
name: #name,
|
name: #name,
|
||||||
|
|
Loading…
Reference in a new issue