From 333afb61f6edbc86966aa98e09bed36f00ca653c Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 12 Oct 2016 15:44:44 +0800 Subject: [PATCH] Use UrlExtraData::make_from to avoid manually cloning the ParserContextExtraData contents. MozReview-Commit-ID: FoCmI6swp5Q --- components/style/properties/longhand/box.mako.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 378cd88bc45..45e64f88f7c 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -968,17 +968,8 @@ ${helpers.single_keyword("-moz-appearance", } let url = context.parse_url(&*try!(input.expect_url())); - match context.extra_data { - ParserContextExtraData { - 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(), - }; + match UrlExtraData::make_from(context) { + Some(extra_data) => { Ok(SpecifiedValue::Url(url, extra_data)) }, _ => {