Skip to content

Commit

Permalink
foreach: use simdutf8
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed May 23, 2023
1 parent adf7052 commit df6b4f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmd/foreach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
.map(|piece| {
let clean_piece = cleaner_pattern.replace_all(piece.as_bytes(), NoExpand(b""));

String::from_utf8(clean_piece.into_owned()).unwrap_or_default()
simdutf8::basic::from_utf8(&clean_piece)
.unwrap_or_default()
.to_string()
})
.collect();

Expand Down

0 comments on commit df6b4f8

Please sign in to comment.