mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
clippy: Fix some warnings in script/dom
(#31915)
* fixed some clippy warnings * resolved conflict * updated texttracklist.rs --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
9303c90159
commit
7ce78f5a74
3 changed files with 5 additions and 9 deletions
|
@ -142,7 +142,7 @@ impl TextTrackMethods for TextTrack {
|
||||||
// gecko calls RemoveCue when the given cue
|
// gecko calls RemoveCue when the given cue
|
||||||
// has an associated track, but doesn't return
|
// has an associated track, but doesn't return
|
||||||
// the error from it, so we wont either.
|
// the error from it, so we wont either.
|
||||||
if let Err(_) = old_track.RemoveCue(cue) {
|
if old_track.RemoveCue(cue).is_err() {
|
||||||
warn!("Failed to remove cues for the added cue's text track");
|
warn!("Failed to remove cues for the added cue's text track");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,7 @@ impl TextTrackCueList {
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.filter(|(_, c)| **c == cue)
|
.find(|(_, c)| **c == cue)
|
||||||
.next()
|
|
||||||
.map(|(i, _)| i)
|
.map(|(i, _)| i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +77,7 @@ impl TextTrackCueListMethods for TextTrackCueList {
|
||||||
self.dom_cues
|
self.dom_cues
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|cue| cue.id() == id)
|
.find(|cue| cue.id() == id)
|
||||||
.next()
|
|
||||||
.map(|t| DomRoot::from_ref(&**t))
|
.map(|t| DomRoot::from_ref(&**t))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,7 @@ impl TextTrackList {
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.filter(|(_, t)| **t == track)
|
.find(|(_, t)| **t == track)
|
||||||
.next()
|
|
||||||
.map(|(i, _)| i)
|
.map(|(i, _)| i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +124,7 @@ impl TextTrackListMethods for TextTrackList {
|
||||||
self.dom_tracks
|
self.dom_tracks
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|track| track.id() == id_str)
|
.find(|track| track.id() == id_str)
|
||||||
.next()
|
|
||||||
.map(|t| DomRoot::from_ref(&**t))
|
.map(|t| DomRoot::from_ref(&**t))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue