Skip to content

Commit

Permalink
fix(templ): natural sort for utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Nov 7, 2024
1 parent ef70385 commit 3e86604
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/rari-doc/src/helpers/subpages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ fn split_into_parts(s: &str) -> Vec<(bool, &str)> {
let mut end = 0;
let mut in_number = false;

for c in s.chars() {
for (i, c) in s.char_indices() {
if c.is_ascii_digit() || c == '.' {
if !in_number {
if start != end {
Expand All @@ -292,7 +292,7 @@ fn split_into_parts(s: &str) -> Vec<(bool, &str)> {
}
in_number = false;
}
end += 1
end = i + c.len_utf8()
}

if start != end {
Expand Down
7 changes: 6 additions & 1 deletion crates/rari-types/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ impl Settings {
}
let s = s
.add_source(File::with_name(".config.toml").required(false))
.add_source(Environment::default())
.add_source(
Environment::default()
.list_separator(",")
.with_list_parse_key("additional_locales_for_generics_and_spas")
.try_parsing(true),
)
.build()?;

let mut settings: Self = s.try_deserialize::<Self>()?.validate();
Expand Down

0 comments on commit 3e86604

Please sign in to comment.