mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +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
|
||||
// has an associated track, but doesn't return
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,7 @@ impl TextTrackCueList {
|
|||
.borrow()
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, c)| **c == cue)
|
||||
.next()
|
||||
.find(|(_, c)| **c == cue)
|
||||
.map(|(i, _)| i)
|
||||
}
|
||||
|
||||
|
@ -78,8 +77,7 @@ impl TextTrackCueListMethods for TextTrackCueList {
|
|||
self.dom_cues
|
||||
.borrow()
|
||||
.iter()
|
||||
.filter(|cue| cue.id() == id)
|
||||
.next()
|
||||
.find(|cue| cue.id() == id)
|
||||
.map(|t| DomRoot::from_ref(&**t))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,8 +49,7 @@ impl TextTrackList {
|
|||
.borrow()
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, t)| **t == track)
|
||||
.next()
|
||||
.find(|(_, t)| **t == track)
|
||||
.map(|(i, _)| i)
|
||||
}
|
||||
|
||||
|
@ -125,8 +124,7 @@ impl TextTrackListMethods for TextTrackList {
|
|||
self.dom_tracks
|
||||
.borrow()
|
||||
.iter()
|
||||
.filter(|track| track.id() == id_str)
|
||||
.next()
|
||||
.find(|track| track.id() == id_str)
|
||||
.map(|t| DomRoot::from_ref(&**t))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue