diff --git a/src/collations.rs b/src/collations.rs index 1da4572..49d0f9d 100644 --- a/src/collations.rs +++ b/src/collations.rs @@ -3846,12 +3846,10 @@ impl<'a> Collation<'a> { pub fn max_len(&self) -> u8 { self.max_len } -} -impl From for Collation<'static> { - /// Convert a collation ID to a collation. - fn from(value: CollationId) -> Self { - match value { + /// Resolve collation id into a collation. + pub const fn resolve(id: CollationId) -> Collation<'static> { + match id { CollationId::UNKNOWN_COLLATION_ID => Self::UNKNOWN_COLLATION, CollationId::BIG5_CHINESE_CI => Self::BIG5_CHINESE_CI_COLLATION, CollationId::LATIN2_CZECH_CS => Self::LATIN2_CZECH_CS_COLLATION, @@ -4142,3 +4140,10 @@ impl From for Collation<'static> { } } } + +impl From for Collation<'static> { + /// Convert a collation ID to a collation. + fn from(value: CollationId) -> Self { + Collation::resolve(value) + } +}