diff --git a/src/picture.rs b/src/picture.rs
@@ -51,16 +51,16 @@ pub struct LicenseType(CreativeCommons);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum CreativeCommons {
/// Creative Commons (without attribution)
- CC0,
+ Cc0,
/// Creative Commons Attributions (derivatives allowed)
- CCBY {
+ CcBy {
version: CreativeCommonsVersion,
non_commercial: bool,
share_alike: bool,
},
// The ND (non-derivatives) option excludes the SA (share alike) option
/// Creative Commons Attributions Non-Derivatives
- CCBYND {
+ CcByNd {
version: CreativeCommonsVersion,
non_commercial: bool,
},
@@ -78,142 +78,142 @@ impl LicenseType {
pub const fn url(&self) -> &'static str {
match self.0 {
// CC0
- CreativeCommons::CC0 => {
+ CreativeCommons::Cc0 => {
"https://creativecommons.org/publicdomain/zero/1.0/"
},
// CC-BY-1
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::One,
non_commercial: false,
share_alike: false,
} => "http://creativecommons.org/licenses/by/1.0/",
// CC-BY-2
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Two,
non_commercial: false,
share_alike: false,
} => "http://creativecommons.org/licenses/by/2.0/",
// CC-BY-3
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Three,
non_commercial: false,
share_alike: false,
} => "http://creativecommons.org/licenses/by/3.0/",
// CC-BY-4
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Four,
non_commercial: false,
share_alike: false,
} => "http://creativecommons.org/licenses/by/4.0/",
// CC-BY-SA-1
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::One,
non_commercial: false,
share_alike: true,
} => "http://creativecommons.org/licenses/by-sa/1.0/",
// CC-BY-SA-2
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Two,
non_commercial: false,
share_alike: true,
} => "http://creativecommons.org/licenses/by-sa/2.0/",
// CC-BY-SA-3
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Three,
non_commercial: false,
share_alike: true,
} => "http://creativecommons.org/licenses/by-sa/3.0/",
// CC-BY-SA-4
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Four,
non_commercial: false,
share_alike: true,
} => "http://creativecommons.org/licenses/by-sa/4.0/",
// CC-BY-NC-1
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::One,
non_commercial: true,
share_alike: false,
} => "http://creativecommons.org/licenses/by-nc/1.0/",
// CC-BY-NC-2
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Two,
non_commercial: true,
share_alike: false,
} => "http://creativecommons.org/licenses/by-nc/2.0/",
// CC-BY-NC-3
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Three,
non_commercial: true,
share_alike: false,
} => "http://creativecommons.org/licenses/by-nc/3.0/",
// CC-BY-NC-4
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Four,
non_commercial: true,
share_alike: false,
} => "http://creativecommons.org/licenses/by-nc/4.0/",
// CC-BY-NC-SA-1
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::One,
non_commercial: true,
share_alike: true,
} => "http://creativecommons.org/licenses/by-nc-sa/1.0/",
// CC-BY-NC-SA-2
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Two,
non_commercial: true,
share_alike: true,
} => "http://creativecommons.org/licenses/by-nc-sa/2.0/",
// CC-BY-NC-SA-3
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Three,
non_commercial: true,
share_alike: true,
} => "http://creativecommons.org/licenses/by-nc-sa/3.0/",
// CC-BY-NC-SA-4
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version: CreativeCommonsVersion::Four,
non_commercial: true,
share_alike: true,
} => "http://creativecommons.org/licenses/by-nc-sa/4.0/",
// CC-BY-ND-1
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::One,
non_commercial: false,
} => "http://creativecommons.org/licenses/by-nd/1.0/",
// CC-BY-ND-2
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Two,
non_commercial: false,
} => "http://creativecommons.org/licenses/by-nd/2.0/",
// CC-BY-ND-3
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Three,
non_commercial: false,
} => "http://creativecommons.org/licenses/by-nd/3.0/",
// CC-BY-ND-4
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Four,
non_commercial: false,
} => "http://creativecommons.org/licenses/by-nd/4.0/",
// CC-BY-NC-ND-1
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::One,
non_commercial: true,
} => "http://creativecommons.org/licenses/by-nc-nd/1.0/",
// CC-BY-NC-ND-2
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Two,
non_commercial: true,
} => "http://creativecommons.org/licenses/by-nc-nd/2.0/",
// CC-BY-NC-ND-3
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Three,
non_commercial: true,
} => "http://creativecommons.org/licenses/by-nc-nd/3.0/",
// CC-BY-NC-ND-4
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version: CreativeCommonsVersion::Four,
non_commercial: true,
} => "http://creativecommons.org/licenses/by-nc-nd/4.0/",
@@ -228,7 +228,7 @@ impl LicenseType {
if s == "PD" {
return Ok(None);
} else if s == "CC0" {
- return Ok(Some(Self(CreativeCommons::CC0)));
+ return Ok(Some(Self(CreativeCommons::Cc0)));
}
assert!(s.len() >= 3,
@@ -249,7 +249,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version,
non_commercial: false,
share_alike: false,
@@ -262,7 +262,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version,
non_commercial: true,
share_alike: false,
@@ -275,7 +275,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version,
non_commercial: false,
share_alike: true,
@@ -288,7 +288,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBY {
+ CreativeCommons::CcBy {
version,
non_commercial: true,
share_alike: true,
@@ -301,7 +301,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version,
non_commercial: false,
}
@@ -313,7 +313,7 @@ impl LicenseType {
Ok(
Some(
Self(
- CreativeCommons::CCBYND {
+ CreativeCommons::CcByNd {
version,
non_commercial: true,
}
@@ -379,8 +379,8 @@ impl<'de> Deserialize<'de> for Picture {
impl Display for LicenseType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
match self.0 {
- CreativeCommons::CC0 => write!(f, "CC0"),
- CreativeCommons::CCBY { version, non_commercial, share_alike } => {
+ CreativeCommons::Cc0 => write!(f, "CC0"),
+ CreativeCommons::CcBy { version, non_commercial, share_alike } => {
write!(f, "CC-BY")?;
if non_commercial {
write!(f, "-NC")?;
@@ -390,7 +390,7 @@ impl Display for LicenseType {
}
write!(f, " {version}")
},
- CreativeCommons::CCBYND { version, non_commercial } => {
+ CreativeCommons::CcByNd { version, non_commercial } => {
write!(f, "CC-BY")?;
if non_commercial {
write!(f, "-NC")?;