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

@ -990,7 +990,7 @@ impl Parse for MozImageRect {
input.try(|i| i.expect_function_matching("-moz-image-rect"))?;
input.parse_nested_block(|i| {
let string = i.expect_url_or_string()?;
let url = SpecifiedImageUrl::parse_from_string(string.as_ref().to_owned(), context)?;
let url = SpecifiedImageUrl::parse_from_string(string.as_ref().to_owned(), context);
i.expect_comma()?;
let top = NumberOrPercentage::parse_non_negative(context, i)?;
i.expect_comma()?;