mirror of
https://github.com/RGBCube/dix
synced 2025-07-28 04:07:46 +00:00
fix: don't use nightly features
This commit is contained in:
parent
baaf63fdf2
commit
416dc0c455
1 changed files with 15 additions and 12 deletions
27
src/main.rs
27
src/main.rs
|
@ -185,18 +185,21 @@ fn main() {
|
|||
|
||||
let mut chars = message.char_indices();
|
||||
|
||||
let _ = if let Some((_, first)) = chars.next()
|
||||
&& let Some((second_start, second)) = chars.next()
|
||||
&& second.is_lowercase()
|
||||
{
|
||||
writeln!(
|
||||
err,
|
||||
"{first_lowercase}{rest}",
|
||||
first_lowercase = first.to_lowercase(),
|
||||
rest = &message[second_start..],
|
||||
)
|
||||
} else {
|
||||
writeln!(err, "{message}")
|
||||
let _ = match (chars.next(), chars.next()) {
|
||||
(Some((_, first)), Some((second_start, second)))
|
||||
if second.is_lowercase() =>
|
||||
{
|
||||
writeln!(
|
||||
err,
|
||||
"{first_lowercase}{rest}",
|
||||
first_lowercase = first.to_lowercase(),
|
||||
rest = &message[second_start..],
|
||||
)
|
||||
},
|
||||
|
||||
_ => {
|
||||
writeln!(err, "{message}")
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue