Use UrlExtraData::make_from to avoid manually cloning the ParserContextExtraData contents.

MozReview-Commit-ID: FoCmI6swp5Q
This commit is contained in:
Cameron McCormack 2016-10-12 15:44:44 +08:00
parent c1abd8797c
commit 333afb61f6

View file

@ -968,17 +968,8 @@ ${helpers.single_keyword("-moz-appearance",
} }
let url = context.parse_url(&*try!(input.expect_url())); let url = context.parse_url(&*try!(input.expect_url()));
match context.extra_data { match UrlExtraData::make_from(context) {
ParserContextExtraData { Some(extra_data) => {
base: Some(ref base),
referrer: Some(ref referrer),
principal: Some(ref principal),
} => {
let extra_data = UrlExtraData {
base: base.clone(),
referrer: referrer.clone(),
principal: principal.clone(),
};
Ok(SpecifiedValue::Url(url, extra_data)) Ok(SpecifiedValue::Url(url, extra_data))
}, },
_ => { _ => {