remove unnecessary assignment.

This commit is contained in:
mark 2022-11-20 22:10:41 +01:00
parent 3df99e72fd
commit 1a50e90514

View File

@ -11,12 +11,9 @@ fn main() {
if separators.contains(&c) {
'_'
} else {
let x = c.to_lowercase().next();
x.expect(&format!(
"Error: couldn't convert character to lowercase: `{}`",
c
));
x.unwrap()
c.to_lowercase().next().unwrap_or_else(|| {
panic!("Error: couldn't convert character to lowercase: `{}`", c)
})
}
})
.collect();