refactor: use one global static collator
This commit is contained in:
@ -2,9 +2,9 @@ use std::cmp::Ordering;
|
||||
use chrono::NaiveDateTime;
|
||||
use crate::schema::projects;
|
||||
use diesel::prelude::*;
|
||||
use feruca::Collator;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use validator::Validate;
|
||||
use crate::internationalization::COLLATOR;
|
||||
|
||||
const TITLE_LENGTH_MIN: u64 = 1;
|
||||
const TITLE_LENGTH_MAX: u64 = 255;
|
||||
@ -47,7 +47,7 @@ impl PartialOrd<Self> for Project {
|
||||
|
||||
impl Ord for Project {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
Collator::default().collate(self.title(), other.title())
|
||||
COLLATOR.lock().unwrap().collate(self.title(), other.title())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user