fix: tests, clippy lints

This commit is contained in:
ThetaDev 2023-10-08 01:04:52 +02:00
parent e247b0c5d9
commit 1ec1666d77
4 changed files with 24 additions and 24 deletions

View file

@ -228,16 +228,15 @@ pub enum Country {
.to_owned();
for (code, native_name) in &languages {
let enum_name = code
.split('-')
.map(|c| {
format!(
"{}{}",
c[0..1].to_owned().to_uppercase(),
c[1..].to_owned().to_lowercase()
)
})
.collect::<String>();
let enum_name = code.split('-').fold(String::new(), |mut output, c| {
let _ = write!(
output,
"{}{}",
c[0..1].to_owned().to_uppercase(),
c[1..].to_owned().to_lowercase()
);
output
});
let en_name = lang_names.get(code).expect(code);