diff --git a/helix-core/src/case_conversion.rs b/helix-core/src/case_conversion.rs index f0268eed7..358bdf622 100644 --- a/helix-core/src/case_conversion.rs +++ b/helix-core/src/case_conversion.rs @@ -135,11 +135,11 @@ pub fn into_alternate_case(chars: impl Iterator, buf: &mut Tendril) } pub fn into_uppercase(chars: impl Iterator, buf: &mut Tendril) { - *buf = chars.map(|ch| char::to_ascii_uppercase(&ch)).collect(); + *buf = chars.flat_map(char::to_uppercase).collect(); } pub fn into_lowercase(chars: impl Iterator, buf: &mut Tendril) { - *buf = chars.map(|ch| char::to_ascii_lowercase(&ch)).collect(); + *buf = chars.flat_map(char::to_lowercase).collect(); } pub fn into_kebab_case(chars: impl Iterator, buf: &mut Tendril) { diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index adf7b4555..07de5adee 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -70,7 +70,6 @@ use crate::{ use crate::job::{self, Jobs}; use std::{ - char::{ToLowercase, ToUppercase}, cmp::Ordering, collections::{HashMap, HashSet}, error::Error, @@ -1739,23 +1738,6 @@ where exit_select_mode(cx); } -fn switch_case(cx: &mut Context) { - switch_case_impl(cx, |string| { - string - .chars() - .flat_map(|ch| { - if ch.is_lowercase() { - CaseSwitcher::Upper(ch.to_uppercase()) - } else if ch.is_uppercase() { - CaseSwitcher::Lower(ch.to_lowercase()) - } else { - CaseSwitcher::Keep(Some(ch)) - } - }) - .collect() - }); -} - fn switch_to_pascal_case(cx: &mut Context) { switch_case_impl(cx, |chars| to_pascal_case(chars)) }