From 277835445538c21d5e7d34e28ff22fc23c7ee1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 2 Jan 2017 03:32:55 +0100 Subject: [PATCH] style: Document nsCSSShadowArray sugar. --- .../style/gecko_bindings/sugar/ns_css_shadow_array.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/style/gecko_bindings/sugar/ns_css_shadow_array.rs b/components/style/gecko_bindings/sugar/ns_css_shadow_array.rs index bfc9c2c6432..5de5147b54b 100644 --- a/components/style/gecko_bindings/sugar/ns_css_shadow_array.rs +++ b/components/style/gecko_bindings/sugar/ns_css_shadow_array.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +//! Rust helpers for Gecko's `nsCSSShadowArray`. + use gecko_bindings::bindings::Gecko_AddRefCSSShadowArrayArbitraryThread; use gecko_bindings::bindings::Gecko_NewCSSShadowArray; use gecko_bindings::bindings::Gecko_ReleaseCSSShadowArrayArbitraryThread; @@ -10,6 +12,7 @@ use std::{ptr, slice}; use std::ops::{Deref, DerefMut}; impl RefPtr { + /// Replaces the current `nsCSSShadowArray` with a new one of len `len`. pub fn replace_with_new(&mut self, len: u32) { unsafe { if !self.mRawPtr.is_null() { @@ -23,6 +26,12 @@ impl RefPtr { } } } + + /// Sets the value to other `nsCSSShadowArray`, bumping and decreasing + /// refcounts as needed. + /// + /// TODO(emilio): Seems like this could move to `refptr.rs`, and be more + /// generic. pub fn copy_from(&mut self, other: &Self) { unsafe { if !self.mRawPtr.is_null() {