mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
clippy: Fix search_is_some warnings (#31971)
This commit is contained in:
parent
71f4c5c916
commit
da3991c8f3
3 changed files with 6 additions and 12 deletions
|
@ -131,7 +131,7 @@ impl MediaStreamMethods for MediaStream {
|
|||
|
||||
/// <https://w3c.github.io/mediacapture-main/#dom-mediastream-addtrack>
|
||||
fn AddTrack(&self, track: &MediaStreamTrack) {
|
||||
let existing = self.tracks.borrow().iter().find(|x| *x == &track).is_some();
|
||||
let existing = self.tracks.borrow().iter().any(|x| x == &track);
|
||||
|
||||
if existing {
|
||||
return;
|
||||
|
|
|
@ -1909,11 +1909,7 @@ impl Window {
|
|||
|
||||
let mut images = self.pending_layout_images.borrow_mut();
|
||||
let nodes = images.entry(id).or_default();
|
||||
if nodes
|
||||
.iter()
|
||||
.find(|n| &***n as *const _ == &*node as *const _)
|
||||
.is_none()
|
||||
{
|
||||
if !nodes.iter().any(|n| &**n as *const _ == &*node as *const _) {
|
||||
let (responder, responder_listener) =
|
||||
ProfiledIpc::channel(self.global().time_profiler_chan().clone()).unwrap();
|
||||
let image_cache_chan = self.image_cache_chan.clone();
|
||||
|
|
|
@ -779,13 +779,12 @@ impl XRSessionMethods for XRSession {
|
|||
(!self.is_immersive() || ty != XRReferenceSpaceType::Local)
|
||||
{
|
||||
let s = ty.as_str();
|
||||
if self
|
||||
if !self
|
||||
.session
|
||||
.borrow()
|
||||
.granted_features()
|
||||
.iter()
|
||||
.find(|f| **f == s)
|
||||
.is_none()
|
||||
.any(|f| *f == s)
|
||||
{
|
||||
p.reject_error(Error::NotSupported);
|
||||
return p;
|
||||
|
@ -833,13 +832,12 @@ impl XRSessionMethods for XRSession {
|
|||
fn RequestHitTestSource(&self, options: &XRHitTestOptionsInit) -> Rc<Promise> {
|
||||
let p = Promise::new(&self.global());
|
||||
|
||||
if self
|
||||
if !self
|
||||
.session
|
||||
.borrow()
|
||||
.granted_features()
|
||||
.iter()
|
||||
.find(|f| &**f == "hit-test")
|
||||
.is_none()
|
||||
.any(|f| &*f == "hit-test")
|
||||
{
|
||||
p.reject_error(Error::NotSupported);
|
||||
return p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue