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

@ -158,7 +158,7 @@ impl<'a, 'i, R: ParseErrorReporter> AtRuleParser<'i> for TopLevelRuleParser<'a,
}
let url_string = input.expect_url_or_string()?.as_ref().to_owned();
let url = CssUrl::parse_from_string(url_string, &self.context)?;
let url = CssUrl::parse_from_string(url_string, &self.context);
let media = parse_media_query_list(&self.context, input,
self.error_context.error_reporter);