aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/interface.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-01-25 18:06:33 -0600
committerGitHub <noreply@github.com>2018-01-25 18:06:33 -0600
commitc9ba16f9fbdf7f43cb19feedfaaa68c85bbcbe3b (patch)
treeb6b5d9e1539d294fdbba5fec5a545d8aa6552443 /components/script/dom/bindings/interface.rs
parentfc3b1789318afc8f10e160d40b592234fbdb5cf4 (diff)
parent31631cdc47618a1591b6520eab8c82b28ac13bee (diff)
downloadservo-c9ba16f9fbdf7f43cb19feedfaaa68c85bbcbe3b.tar.gz
servo-c9ba16f9fbdf7f43cb19feedfaaa68c85bbcbe3b.zip
Auto merge of #19868 - CYBAI:specific-assertion, r=emilio
Use specific assertions Similar to #19865 r? jdm Note: Should I squash all the commits into one commit? --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because it should not break anything <!-- 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/19868) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/interface.rs')
-rw-r--r--components/script/dom/bindings/interface.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs
index 5fc0c8a0590..47f5ffb8574 100644
--- a/components/script/dom/bindings/interface.rs
+++ b/components/script/dom/bindings/interface.rs
@@ -234,7 +234,7 @@ pub unsafe fn create_named_constructors(
rooted!(in(cx) let mut constructor = ptr::null_mut::<JSObject>());
for &(native, name, arity) in named_constructors {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
let fun = JS_NewFunction(cx,
Some(native),
@@ -324,7 +324,7 @@ pub unsafe fn define_on_global_object(
global: HandleObject,
name: &[u8],
obj: HandleObject) {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
assert!(JS_DefineProperty1(cx,
global,
name.as_ptr() as *const libc::c_char,
@@ -429,7 +429,7 @@ unsafe fn create_unscopable_object(
rval.set(JS_NewPlainObject(cx));
assert!(!rval.ptr.is_null());
for &name in names {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
assert!(JS_DefineProperty(
cx, rval.handle(), name.as_ptr() as *const libc::c_char, TrueHandleValue,
JSPROP_READONLY, None, None));
@@ -437,7 +437,7 @@ unsafe fn create_unscopable_object(
}
unsafe fn define_name(cx: *mut JSContext, obj: HandleObject, name: &[u8]) {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
rooted!(in(cx) let name = JS_AtomizeAndPinString(cx, name.as_ptr() as *const libc::c_char));
assert!(!name.is_null());
assert!(JS_DefineProperty2(cx,