Make changelog in version response optional (#5115)

* Make changelog on version routes optional

* fix clippy

* fix ci
This commit is contained in:
aecsocket
2026-01-14 10:55:20 +00:00
committed by GitHub
parent d055dc68dc
commit f85a2d3ec1
16 changed files with 199 additions and 54 deletions

View File

@@ -4,7 +4,10 @@ use {
std::borrow::Cow,
};
pub fn serialize<S: serde::Serializer>(v: &CountryCode, serializer: S) -> Result<S::Ok, S::Error> {
pub fn serialize<S: serde::Serializer>(
v: &CountryCode,
serializer: S,
) -> Result<S::Ok, S::Error> {
serializer.serialize_str(v.alpha2)
}
@@ -15,6 +18,8 @@ pub fn deserialize<'de, D: serde::Deserializer<'de>>(
rust_iso3166::ALPHA2_MAP
.get(&country_code)
.copied()
.ok_or_else(|| D::Error::custom("invalid ISO 3166 alpha-2 country code"))
.ok_or_else(|| {
D::Error::custom("invalid ISO 3166 alpha-2 country code")
})
})
}