util.rs: Correct a typo

Part-of: <https://gitlab.gnome.org/World/Phosh/squeekboard/-/merge_requests/706>
This commit is contained in:
MoonlightWave-12
2024-11-18 13:36:13 +01:00
parent 30f324c73a
commit f786f8d452

View File

@ -311,7 +311,7 @@ pub trait WarningHandler {
fn handle(&mut self, warning: &str);
}
/// Removes the first matcing item
/// Removes the first matching item
pub fn vec_remove<T, F: FnMut(&T) -> bool>(v: &mut Vec<T>, pred: F) -> Option<T> {
let idx = v.iter().position(pred);
idx.map(|idx| v.remove(idx))