From b3f93b25a58eae456b27ea15423feb5181ab9aa1 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 11 Feb 2015 21:05:03 +0100 Subject: Remove JS::unsafe_get. The codegen users already migrated to Unrooted, and the layout users are better off using LayoutJS. --- components/script/dom/bindings/js.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'components/script/dom/bindings/js.rs') diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index ea4a8af2f56..2abba36b1e1 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -197,7 +197,7 @@ pub struct JS { impl JS { /// Returns `LayoutJS` containing the same pointer. - fn to_layout(self) -> LayoutJS { + pub unsafe fn to_layout(self) -> LayoutJS { LayoutJS { ptr: self.ptr.clone() } @@ -291,7 +291,7 @@ impl JS { impl Reflectable for JS { fn reflector<'a>(&'a self) -> &'a Reflector { unsafe { - (*self.unsafe_get()).reflector() + (**self.ptr).reflector() } } } @@ -419,12 +419,6 @@ impl MutNullableJS { } impl JS { - /// Returns an unsafe pointer to the interior of this object. - /// This should only be used by the DOM bindings. - pub unsafe fn unsafe_get(&self) -> *const T { - *self.ptr - } - /// Store an unrooted value in this field. This is safe under the /// assumption that JS values are only used as fields in DOM types that /// are reachable in the GC graph, so this unrooted value becomes -- cgit v1.2.3