Skip to content

Commit

Permalink
Merge b757f8e into bf2a00a
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad committed Aug 20, 2023
2 parents bf2a00a + b757f8e commit 8385336
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions clafrica/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,13 @@ impl Config {
{
data.clone()
.chain(data.clone().filter_map(|(k, v)| {
if k.chars().next()?.is_lowercase() {
Some((k[0..1].to_uppercase() + &k[1..], v.to_uppercase()))
} else {
None
}
k.chars()
.next()?
.is_lowercase()
.then(|| (k[0..1].to_uppercase() + &k[1..], v.to_uppercase()))
}))
// We overwrite the auto capitalization
.chain(data.filter_map(|(k, v)| {
if k.chars().next()?.is_uppercase() {
Some((k, v))
} else {
None
}
}))
.chain(data.filter_map(|(k, v)| k.chars().next()?.is_uppercase().then_some((k, v))))
.collect()
} else {
data.collect()
Expand Down

0 comments on commit 8385336

Please sign in to comment.