Skip to content

Commit

Permalink
style: Use RefPtr::new instead of RefPtr::from_ptr_ref + clone.
Browse files Browse the repository at this point in the history
Bug: 1461858
Reviewed-by: emilio
  • Loading branch information
upsuper authored and emilio committed May 20, 2018
1 parent ecb2ec6 commit 514aba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/style/gecko/conversions.rs
Expand Up @@ -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 => {
Expand Down
8 changes: 4 additions & 4 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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)
}));
}
_ => {},
Expand Down

0 comments on commit 514aba5

Please sign in to comment.