mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Fix manual_map warnings (#31922)
This commit is contained in:
parent
5d518ca8dc
commit
7349ce5b6a
8 changed files with 34 additions and 51 deletions
|
@ -1941,10 +1941,12 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
pub fn get_current_frame(&self) -> Option<VideoFrame> {
|
||||
match self.video_renderer.lock().unwrap().current_frame_holder {
|
||||
Some(ref holder) => Some(holder.get_frame()),
|
||||
None => None,
|
||||
}
|
||||
self.video_renderer
|
||||
.lock()
|
||||
.unwrap()
|
||||
.current_frame_holder
|
||||
.as_ref()
|
||||
.map(|holder| holder.get_frame())
|
||||
}
|
||||
|
||||
/// By default the audio is rendered through the audio sink automatically
|
||||
|
@ -2088,15 +2090,14 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-media-srcobject
|
||||
fn GetSrcObject(&self) -> Option<MediaStreamOrBlob> {
|
||||
match *self.src_object.borrow() {
|
||||
Some(ref src_object) => Some(match src_object {
|
||||
(*self.src_object.borrow())
|
||||
.as_ref()
|
||||
.map(|src_object| match src_object {
|
||||
SrcObject::Blob(blob) => MediaStreamOrBlob::Blob(DomRoot::from_ref(blob)),
|
||||
SrcObject::MediaStream(stream) => {
|
||||
MediaStreamOrBlob::MediaStream(DomRoot::from_ref(stream))
|
||||
},
|
||||
}),
|
||||
None => None,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-media-srcobject
|
||||
|
@ -2659,10 +2660,10 @@ impl FetchResponseListener for HTMLMediaElementFetchListener {
|
|||
let content_length =
|
||||
if let Some(content_range) = headers.typed_get::<ContentRange>() {
|
||||
content_range.bytes_len()
|
||||
} else if let Some(content_length) = headers.typed_get::<ContentLength>() {
|
||||
Some(content_length.0)
|
||||
} else {
|
||||
None
|
||||
headers
|
||||
.typed_get::<ContentLength>()
|
||||
.map(|content_length| content_length.0)
|
||||
};
|
||||
|
||||
// We only set the expected input size if it changes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue