mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: Make from_image_request infallible.
All callsites already assert, so moving the assertion into the method should be fine. It is not expected to handle a null image value anyway. Bug: 1461858 Reviewed-by: emilio MozReview-Commit-ID: J8CA8m22eSv
This commit is contained in:
parent
dc2aadd43a
commit
45a37503af
2 changed files with 5 additions and 12 deletions
|
@ -4145,9 +4145,7 @@ fn static_assert() {
|
|||
|
||||
unsafe {
|
||||
let ref gecko_image_request = *self.gecko.mListStyleImage.mRawPtr;
|
||||
UrlOrNone::Url(ComputedImageUrl::from_image_request(
|
||||
gecko_image_request
|
||||
).expect("mListStyleImage could not convert to ComputedImageUrl"))
|
||||
UrlOrNone::Url(ComputedImageUrl::from_image_request(gecko_image_request))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5437,7 +5435,6 @@ clip-path
|
|||
let url = unsafe {
|
||||
let gecko_image_request = gecko_cursor_image.mImage.mRawPtr.as_ref().unwrap();
|
||||
ComputedImageUrl::from_image_request(&gecko_image_request)
|
||||
.expect("mCursorImages.mImage could not convert to ComputedImageUrl")
|
||||
};
|
||||
|
||||
let hotspot =
|
||||
|
@ -5713,7 +5710,6 @@ clip-path
|
|||
&**gecko_content.mContent.mImage.as_ref();
|
||||
ContentItem::Url(
|
||||
ComputedImageUrl::from_image_request(gecko_image_request)
|
||||
.expect("mContent could not convert to ComputedImageUrl")
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue