diff options
author | Simon Wülker <simon.wuelker@arcor.de> | 2024-09-16 12:03:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 10:03:52 +0000 |
commit | 7df30f3788a14baa590c9123f5e1616ccfe0a0f0 (patch) | |
tree | 491bdb4447ec1a24c66d1ad91f7c1678ee71b9e1 /components/shared/bluetooth | |
parent | 236cae9ce53019036710032a980966542a64fbce (diff) | |
download | servo-7df30f3788a14baa590c9123f5e1616ccfe0a0f0.tar.gz servo-7df30f3788a14baa590c9123f5e1616ccfe0a0f0.zip |
Replace .map_or(false with Option::is_some_and (#33468)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Diffstat (limited to 'components/shared/bluetooth')
-rw-r--r-- | components/shared/bluetooth/blocklist.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/shared/bluetooth/blocklist.rs b/components/shared/bluetooth/blocklist.rs index ca413c41a1e..0435d6f498b 100644 --- a/components/shared/bluetooth/blocklist.rs +++ b/components/shared/bluetooth/blocklist.rs @@ -37,7 +37,7 @@ impl BluetoothBlocklist { // https://webbluetoothcg.github.io/web-bluetooth/#blocklisted pub fn is_blocklisted(&self, uuid: &str) -> bool { match self.0 { - Some(ref map) => map.get(uuid).map_or(false, |et| et.eq(&Blocklist::All)), + Some(ref map) => map.get(uuid).is_some_and(|et| et.eq(&Blocklist::All)), None => false, } } @@ -45,9 +45,9 @@ impl BluetoothBlocklist { // https://webbluetoothcg.github.io/web-bluetooth/#blocklisted-for-reads pub fn is_blocklisted_for_reads(&self, uuid: &str) -> bool { match self.0 { - Some(ref map) => map.get(uuid).map_or(false, |et| { - et.eq(&Blocklist::All) || et.eq(&Blocklist::Reads) - }), + Some(ref map) => map + .get(uuid) + .is_some_and(|et| et.eq(&Blocklist::All) || et.eq(&Blocklist::Reads)), None => false, } } @@ -55,9 +55,9 @@ impl BluetoothBlocklist { // https://webbluetoothcg.github.io/web-bluetooth/#blocklisted-for-writes pub fn is_blocklisted_for_writes(&self, uuid: &str) -> bool { match self.0 { - Some(ref map) => map.get(uuid).map_or(false, |et| { - et.eq(&Blocklist::All) || et.eq(&Blocklist::Writes) - }), + Some(ref map) => map + .get(uuid) + .is_some_and(|et| et.eq(&Blocklist::All) || et.eq(&Blocklist::Writes)), None => false, } } |