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:
Xidorn Quan 2018-05-16 12:19:31 +10:00 committed by Emilio Cobos Álvarez
parent 0b5720547e
commit dc2aadd43a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 28 additions and 42 deletions

View file

@ -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 => {