aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/validitystate.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2013-10-10 11:49:17 +0200
committerBobby Holley <bobbyholley@gmail.com>2013-10-10 13:11:24 +0200
commitc4bbc4cd37ff604a635b95f39d05913dcaad53fb (patch)
tree72ee7575b773159ad7d8e0f68cfcf575e16f8700 /src/components/script/dom/validitystate.rs
parente6be738d97d3e91741b4c064bd803fa8822aff96 (diff)
downloadservo-c4bbc4cd37ff604a635b95f39d05913dcaad53fb.tar.gz
servo-c4bbc4cd37ff604a635b95f39d05913dcaad53fb.zip
Introduce mutable/immutable variants of reflector() with named lifetimes, and kill unsafe casts.
Diffstat (limited to 'src/components/script/dom/validitystate.rs')
-rw-r--r--src/components/script/dom/validitystate.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/script/dom/validitystate.rs b/src/components/script/dom/validitystate.rs
index 0aeab8ae72a..73819ca9839 100644
--- a/src/components/script/dom/validitystate.rs
+++ b/src/components/script/dom/validitystate.rs
@@ -5,7 +5,6 @@
use dom::bindings::utils::{Reflector, BindingObject, Reflectable};
use dom::bindings::codegen::ValidityStateBinding;
use js::jsapi::{JSContext, JSObject};
-use std::cast;
pub struct ValidityState {
reflector_: Reflector,
@@ -60,8 +59,12 @@ impl ValidityState {
}
impl Reflectable for ValidityState {
- fn reflector(&mut self) -> &mut Reflector {
- unsafe { cast::transmute(&self.reflector_) }
+ fn reflector<'a>(&'a self) -> &'a Reflector {
+ &self.reflector_
+ }
+
+ fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
+ &mut self.reflector_
}
fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {