Do proper Unicode collation on room names (#440)

This commit is contained in:
Ulyssa 2025-05-31 12:52:15 -07:00 committed by GitHub
parent 9ed9400b67
commit ba7d0392d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 85 additions and 21 deletions

View file

@ -1,7 +1,7 @@
//! # Logic for loading and validating application configuration
use std::borrow::Cow;
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};
use std::fmt;
use std::fs::File;
use std::hash::{Hash, Hasher};
@ -105,7 +105,7 @@ fn validate_profile_name(name: &str) -> bool {
name.chars().all(is_profile_char)
}
fn validate_profile_names(names: &HashMap<String, ProfileConfig>) {
fn validate_profile_names(names: &BTreeMap<String, ProfileConfig>) {
for name in names.keys() {
if validate_profile_name(name.as_str()) {
continue;
@ -787,7 +787,7 @@ pub struct ProfileConfig {
#[derive(Clone, Deserialize)]
pub struct IambConfig {
pub profiles: HashMap<String, ProfileConfig>,
pub profiles: BTreeMap<String, ProfileConfig>,
pub default_profile: Option<String>,
pub settings: Option<Tunables>,
pub dirs: Option<Directories>,