Skip to content

Commit 227e384

Browse files
committed
Introduce Collation::resolve
1 parent 8695d40 commit 227e384

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/collations.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,12 +3846,10 @@ impl<'a> Collation<'a> {
38463846
pub fn max_len(&self) -> u8 {
38473847
self.max_len
38483848
}
3849-
}
38503849

3851-
impl From<CollationId> for Collation<'static> {
3852-
/// Convert a collation ID to a collation.
3853-
fn from(value: CollationId) -> Self {
3854-
match value {
3850+
/// Resolve collation id into a collation.
3851+
pub const fn resolve(id: CollationId) -> Collation<'static> {
3852+
match id {
38553853
CollationId::UNKNOWN_COLLATION_ID => Self::UNKNOWN_COLLATION,
38563854
CollationId::BIG5_CHINESE_CI => Self::BIG5_CHINESE_CI_COLLATION,
38573855
CollationId::LATIN2_CZECH_CS => Self::LATIN2_CZECH_CS_COLLATION,
@@ -4142,3 +4140,10 @@ impl From<CollationId> for Collation<'static> {
41424140
}
41434141
}
41444142
}
4143+
4144+
impl From<CollationId> for Collation<'static> {
4145+
/// Convert a collation ID to a collation.
4146+
fn from(value: CollationId) -> Self {
4147+
Collation::resolve(value)
4148+
}
4149+
}

0 commit comments

Comments
 (0)