diff options
author | Xidorn Quan <me@upsuper.org> | 2018-05-16 22:21:57 +1000 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-05-20 18:58:44 +0200 |
commit | 514aba51adc0fb0558881ae91832153d7586ddb3 (patch) | |
tree | 89d909cb35ac9d5af30bac5a5531c95b8e55beb0 | |
parent | ecb2ec63de0ef76c15cb1ccf9d8a2d9c438c97c4 (diff) | |
download | servo-514aba51adc0fb0558881ae91832153d7586ddb3.tar.gz servo-514aba51adc0fb0558881ae91832153d7586ddb3.zip |
style: Use RefPtr::new instead of RefPtr::from_ptr_ref + clone.
Bug: 1461858
Reviewed-by: emilio
-rw-r--r-- | components/style/gecko/conversions.rs | 4 | ||||
-rw-r--r-- | components/style/properties/gecko.mako.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 314ded9cb1c..bbc2776daa9 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -679,8 +679,8 @@ pub mod basic_shape { match other.mType { StyleShapeSourceType::URL => unsafe { let shape_image = &*other.mShapeImage.mPtr; - let other_url = RefPtr::from_ptr_ref(shape_image.__bindgen_anon_1.mURLValue.as_ref()); - let url = ComputedUrl::from_url_value(other_url.clone()); + let other_url = RefPtr::new(*shape_image.__bindgen_anon_1.mURLValue.as_ref()); + let url = ComputedUrl::from_url_value(other_url); ShapeSource::ImageOrUrl(url) }, StyleShapeSourceType::Image => { diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index bb71edaa7c3..b86a59fc6e5 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -760,8 +760,8 @@ def set_gecko_property(ffi_name, expr): nsStyleSVGPaintType::eStyleSVGPaintType_ContextStroke => SVGPaintKind::ContextStroke, nsStyleSVGPaintType::eStyleSVGPaintType_Server => { SVGPaintKind::PaintServer(unsafe { - let url = RefPtr::from_ptr_ref(paint.mPaint.mPaintServer.as_ref()); - ComputedUrl::from_url_value(url.clone()) + let url = RefPtr::new(*paint.mPaint.mPaintServer.as_ref()); + ComputedUrl::from_url_value(url) }) } nsStyleSVGPaintType::eStyleSVGPaintType_Color => { @@ -4546,8 +4546,8 @@ fn static_assert() { }, NS_STYLE_FILTER_URL => { filters.push(Filter::Url(unsafe { - let url = RefPtr::from_ptr_ref(filter.__bindgen_anon_1.mURL.as_ref()); - ComputedUrl::from_url_value(url.clone()) + let url = RefPtr::new(*filter.__bindgen_anon_1.mURL.as_ref()); + ComputedUrl::from_url_value(url) })); } _ => {}, |