mln_expression/
collator.rs1#[derive(Clone, Debug, PartialEq, Eq)]
11struct PlatformCollator {
12 case_sensitive: bool,
13 diacritic_sensitive: bool,
14}
15
16impl PlatformCollator {
17 fn compare(&self, lhs: &str, rhs: &str) -> i32 {
18 nunicode::collator_compare(lhs, rhs, self.case_sensitive, self.diacritic_sensitive)
19 }
20
21 fn resolved_locale(&self) -> String {
22 String::new()
23 }
24}
25
26#[derive(Clone, Debug, PartialEq, Eq)]
28pub struct Collator {
29 collator: PlatformCollator,
30}
31
32impl Collator {
33 pub fn new(case_sensitive: bool, diacritic_sensitive: bool, _locale: Option<String>) -> Self {
34 Collator {
35 collator: PlatformCollator {
36 case_sensitive,
37 diacritic_sensitive,
38 },
39 }
40 }
41
42 pub fn compare(&self, lhs: &str, rhs: &str) -> i32 {
43 self.collator.compare(lhs, rhs)
44 }
45
46 pub fn resolved_locale(&self) -> String {
47 self.collator.resolved_locale()
48 }
49}