fix: tests, clippy lints
This commit is contained in:
parent
e247b0c5d9
commit
1ec1666d77
4 changed files with 24 additions and 24 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,12 +134,16 @@ where
|
|||
if c.is_ascii_digit() {
|
||||
buf.push(c);
|
||||
} else if !buf.is_empty() {
|
||||
buf.parse::<F>().map_or((), |n| numbers.push(n));
|
||||
if let Ok(n) = buf.parse::<F>() {
|
||||
numbers.push(n);
|
||||
}
|
||||
buf.clear();
|
||||
}
|
||||
}
|
||||
if !buf.is_empty() {
|
||||
buf.parse::<F>().map_or((), |n| numbers.push(n));
|
||||
if let Ok(n) = buf.parse::<F>() {
|
||||
numbers.push(n);
|
||||
}
|
||||
}
|
||||
|
||||
numbers
|
||||
|
|
|
|||
Reference in a new issue