Skip to content

Commit

Permalink
client: Reduce filter_map + next to find_map
Browse files Browse the repository at this point in the history
  • Loading branch information
hw0lff committed Oct 29, 2023
1 parent 9b43e67 commit 869cca8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions wayland-client/src/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ 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))
} else {
None
}
})
.next()
.ok_or(BindError::NotPresent)?;

// Test version requirements
Expand Down

0 comments on commit 869cca8

Please sign in to comment.