refactor: remove unneeded loop, replace with map instead

pull/12043/head
Nikita Revenco 2025-01-11 17:45:50 +00:00
parent d7a3ffa2d8
commit 5420ef5f63
1 changed files with 1 additions and 3 deletions

View File

@ -7,9 +7,7 @@ pub fn simple_case_conversion(
buf: &mut Tendril,
transform_char: impl Fn(&char) -> char,
) {
for c in text {
buf.push(transform_char(&c))
}
*buf = text.map(|ch| transform_char(&ch)).collect();
}
pub fn smart_case_conversion(