Give more license to the license field (#572)
This commit is contained in:
parent
a4cac24aee
commit
66162e9896
|
@ -30,16 +30,19 @@ impl From<import::License> for License {
|
||||||
match license {
|
match license {
|
||||||
import::License::None { .. } => License {
|
import::License::None { .. } => License {
|
||||||
url: None,
|
url: None,
|
||||||
fullName: "No License Specified".to_string(),
|
fullName: "no license specified".to_string(),
|
||||||
},
|
},
|
||||||
import::License::Simple { license } => License {
|
import::License::Simple { license } => License {
|
||||||
url: None,
|
url: None,
|
||||||
fullName: license,
|
fullName: license,
|
||||||
},
|
},
|
||||||
import::License::Full { fullName, url, .. } => License { url, fullName },
|
import::License::Full {
|
||||||
import::License::Url { url } => License {
|
fullName,
|
||||||
url: Some(url),
|
shortName,
|
||||||
fullName: "No Name".into(),
|
url,
|
||||||
|
} => License {
|
||||||
|
url,
|
||||||
|
fullName: fullName.unwrap_or(shortName.unwrap_or("custom".into())),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,13 +264,10 @@ pub enum License {
|
||||||
},
|
},
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
Full {
|
Full {
|
||||||
fullName: String,
|
fullName: Option<String>,
|
||||||
// shortName: String,
|
shortName: Option<String>,
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
},
|
},
|
||||||
Url {
|
|
||||||
url: String,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for License {
|
impl Default for License {
|
||||||
|
|
Loading…
Reference in a new issue