mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
style: Make creating CssUrl infallible.
There were a check in CssUrl::parse_from_string for extra data, which was removed as part of servo/servo#16241, so it never fails now. CssUrl::from_url_value_data doesn't seem to need Result from the very beginning. It is unclear why it was made that way. Bug: 1461858 Reviewed-by: emilio MozReview-Commit-ID: LXzKlZ6wPYW
This commit is contained in:
parent
0b5720547e
commit
dc2aadd43a
6 changed files with 28 additions and 42 deletions
|
@ -429,7 +429,6 @@ impl nsStyleImage {
|
|||
unsafe fn get_image_url(self: &nsStyleImage) -> ComputedImageUrl {
|
||||
let url_value = bindings::Gecko_GetURLValue(self);
|
||||
ComputedImageUrl::from_url_value_data(url_value.as_ref().unwrap())
|
||||
.expect("Could not convert to ComputedUrl")
|
||||
}
|
||||
|
||||
unsafe fn get_gradient(self: &nsStyleImage) -> Box<Gradient> {
|
||||
|
@ -679,7 +678,7 @@ pub mod basic_shape {
|
|||
StyleShapeSourceType::URL => unsafe {
|
||||
let shape_image = &*other.mShapeImage.mPtr;
|
||||
let other_url = &(**shape_image.__bindgen_anon_1.mURLValue.as_ref());
|
||||
let url = ComputedUrl::from_url_value_data(&other_url._base).unwrap();
|
||||
let url = ComputedUrl::from_url_value_data(&other_url._base);
|
||||
ShapeSource::ImageOrUrl(url)
|
||||
},
|
||||
StyleShapeSourceType::Image => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue