From 869cca8f0a184063dd80596a6a29b989093f768c Mon Sep 17 00:00:00 2001 From: Hendrik Wolff Date: Sun, 29 Oct 2023 16:40:38 +0100 Subject: [PATCH] client: Reduce `filter_map` + `next` to `find_map` --- wayland-client/src/globals.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wayland-client/src/globals.rs b/wayland-client/src/globals.rs index ab9f1a52dd1..87fe4afdd4b 100644 --- a/wayland-client/src/globals.rs +++ b/wayland-client/src/globals.rs @@ -155,7 +155,7 @@ impl GlobalList { let (name, version) = guard .iter() // Find the with the correct interface - .filter_map(|Global { name, interface: interface_name, version }| { + .find_map(|Global { name, interface: interface_name, version }| { // TODO: then_some if interface.name == &interface_name[..] { Some((*name, *version)) @@ -163,7 +163,6 @@ impl GlobalList { None } }) - .next() .ok_or(BindError::NotPresent)?; // Test version requirements