Give more license to the license field (#572)

This commit is contained in:
Naïm Favier 2022-12-02 13:46:35 +01:00 committed by GitHub
parent a4cac24aee
commit 66162e9896
Failed to generate hash of commit
2 changed files with 10 additions and 10 deletions

View file

@ -30,16 +30,19 @@ impl From<import::License> for License {
match license {
import::License::None { .. } => License {
url: None,
fullName: "No License Specified".to_string(),
fullName: "no license specified".to_string(),
},
import::License::Simple { license } => License {
url: None,
fullName: license,
},
import::License::Full { fullName, url, .. } => License { url, fullName },
import::License::Url { url } => License {
url: Some(url),
fullName: "No Name".into(),
import::License::Full {
fullName,
shortName,
url,
} => License {
url,
fullName: fullName.unwrap_or(shortName.unwrap_or("custom".into())),
},
}
}

View file

@ -264,13 +264,10 @@ pub enum License {
},
#[allow(non_snake_case)]
Full {
fullName: String,
// shortName: String,
fullName: Option<String>,
shortName: Option<String>,
url: Option<String>,
},
Url {
url: String,
},
}
impl Default for License {