aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/crypto.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-10-16 17:07:50 -0500
committerGitHub <noreply@github.com>2017-10-16 17:07:50 -0500
commite8a6f2862c2a6084e4f4e64ab466c89ae83cff59 (patch)
tree645db1e37eceef034743c28f9af1544a3fff6d8d /components/script/dom/crypto.rs
parent3209d22968046b5c3d29a37b79a655497db2050a (diff)
parent49e4540ece8641afcb6534a9c3b74e88895f5447 (diff)
downloadservo-e8a6f2862c2a6084e4f4e64ab466c89ae83cff59.tar.gz
servo-e8a6f2862c2a6084e4f4e64ab466c89ae83cff59.zip
Auto merge of #18875 - servo:stable-js, r=nox,jdm
Remove the need for rust-mozjs to use unstable Rust features <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18875) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/crypto.rs')
-rw-r--r--components/script/dom/crypto.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs
index 2093c1cff50..ac56e9f3ff6 100644
--- a/components/script/dom/crypto.rs
+++ b/components/script/dom/crypto.rs
@@ -2,11 +2,11 @@
* 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/. */
-use core::nonzero::NonZero;
use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::CryptoBinding;
use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods;
use dom::bindings::error::{Error, Fallible};
+use dom::bindings::nonnull::NonNullJSObjectPtr;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::root::DomRoot;
use dom::globalscope::GlobalScope;
@@ -44,7 +44,7 @@ impl CryptoMethods for Crypto {
unsafe fn GetRandomValues(&self,
_cx: *mut JSContext,
input: *mut JSObject)
- -> Fallible<NonZero<*mut JSObject>> {
+ -> Fallible<NonNullJSObjectPtr> {
assert!(!input.is_null());
typedarray!(in(_cx) let mut array_buffer_view: ArrayBufferView = input);
let (array_type, mut data) = match array_buffer_view.as_mut() {
@@ -65,7 +65,7 @@ impl CryptoMethods for Crypto {
self.rng.borrow_mut().fill_bytes(&mut data);
- Ok(NonZero::new_unchecked(input))
+ Ok(NonNullJSObjectPtr::new_unchecked(input))
}
}