use retain instead of .chars().filter()

This commit is contained in:
Simon Gardling 2022-06-04 14:16:25 -04:00
parent a6fb445e5d
commit 02dbfd78bc

View File

@ -113,10 +113,7 @@ impl FunctionManager {
);
// Only keep valid chars
new_string = new_string
.chars()
.filter(crate::misc::is_valid_char)
.collect::<String>();
new_string.retain(|c| crate::misc::is_valid_char(&c));
// If not fully open, return here as buttons cannot yet be displayed, therefore the user is inable to mark it for deletion
if ui.ctx().animate_bool(*te_id, re.has_focus()) == 1.0 {