Replace assert! in animation code with debug_assert!

This commit is contained in:
Xidorn Quan 2017-03-06 21:58:08 +11:00
parent c62973b77b
commit 4bc0cac395

View file

@ -1324,7 +1324,7 @@ fn static_assert() {
<%def name="impl_animation_time_value(ident, gecko_ffi_name)">
#[allow(non_snake_case)]
pub fn set_animation_${ident}(&mut self, v: longhands::animation_${ident}::computed_value::T) {
assert!(v.0.len() > 0);
debug_assert!(!v.0.is_empty());
unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
self.gecko.mAnimation${gecko_ffi_name}Count = v.0.len() as u32;
@ -1348,7 +1348,7 @@ fn static_assert() {
use properties::longhands::animation_${ident}::single_value::computed_value::T as Keyword;
use gecko_bindings::structs;
assert!(v.0.len() > 0);
debug_assert!(!v.0.is_empty());
unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
self.gecko.mAnimation${gecko_ffi_name}Count = v.0.len() as u32;
@ -1773,7 +1773,7 @@ fn static_assert() {
use std::f32;
use properties::longhands::animation_iteration_count::single_value::SpecifiedValue as AnimationIterationCount;
assert!(v.0.len() > 0);
debug_assert!(!v.0.is_empty());
unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
self.gecko.mAnimationIterationCountCount = v.0.len() as u32;
@ -1799,7 +1799,7 @@ fn static_assert() {
${impl_copy_animation_value('iteration_count', 'IterationCount')}
pub fn set_animation_timing_function(&mut self, v: longhands::animation_timing_function::computed_value::T) {
assert!(v.0.len() > 0);
debug_assert!(!v.0.is_empty());
unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) };
self.gecko.mAnimationTimingFunctionCount = v.0.len() as u32;