Change debug assertions to specific ones

This commit is contained in:
janczer 2018-02-07 09:18:59 +01:00
parent 2cf0077be1
commit 661d234c3c
23 changed files with 53 additions and 53 deletions

View file

@ -485,7 +485,7 @@ pub enum MarginsMayCollapseFlag {
MarginsMayNotCollapse,
}
#[derive(PartialEq)]
#[derive(Debug, PartialEq)]
pub enum FormattingContextType {
None,
Block,
@ -1472,7 +1472,7 @@ impl BlockFlow {
fn assign_inline_position_for_formatting_context(&mut self,
layout_context: &LayoutContext,
content_box: LogicalRect<Au>) {
debug_assert!(self.formatting_context_type() != FormattingContextType::None);
debug_assert_ne!(self.formatting_context_type(), FormattingContextType::None);
if !self.base.restyle_damage.intersects(ServoRestyleDamage::REFLOW_OUT_OF_FLOW | ServoRestyleDamage::REFLOW) {
return

View file

@ -269,7 +269,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
},
DisplayItem::PushStackingContext(ref item) => {
let stacking_context = &item.stacking_context;
debug_assert!(stacking_context.context_type == StackingContextType::Real);
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);
let transform = stacking_context
.transform

View file

@ -767,7 +767,7 @@ impl Fragment {
let ellipsis_fragments = with_thread_local_font_context(layout_context, |font_context| {
TextRunScanner::new().scan_for_runs(font_context, unscanned_ellipsis_fragments)
});
debug_assert!(ellipsis_fragments.len() == 1);
debug_assert_eq!(ellipsis_fragments.len(), 1);
ellipsis_fragment = ellipsis_fragments.fragments.into_iter().next().unwrap();
ellipsis_fragment.flags |= FragmentFlags::IS_ELLIPSIS;
ellipsis_fragment

View file

@ -804,7 +804,7 @@ impl LineBreaker {
self.work_list.push_front(cur_fragment);
for fragment_index in (last_known_line_breaking_opportunity.get()..
self.pending_line.range.end().get()).rev() {
debug_assert!(fragment_index == (self.new_fragments.len() as isize) - 1);
debug_assert_eq!(fragment_index, (self.new_fragments.len() as isize) - 1);
self.work_list.push_front(self.new_fragments.pop().unwrap());
}

View file

@ -125,7 +125,7 @@ impl TableFlow {
}
} else {
// We discovered a new column. Initialize its data.
debug_assert!(column_index == parent_inline_sizes.len());
debug_assert_eq!(column_index, parent_inline_sizes.len());
if child_cell_inline_size.column_span > 1 {
// TODO(pcwalton): Perform the recursive algorithm specified in INTRINSIC §
// 4. For now we make this column contribute no width.
@ -635,7 +635,7 @@ impl<T> VecExt<T> for Vec<T> {
if index < self.len() {
self[index] = value
} else {
debug_assert!(index == self.len());
debug_assert_eq!(index, self.len());
self.push(value)
}
&mut self[index]
@ -643,7 +643,7 @@ impl<T> VecExt<T> for Vec<T> {
fn get_mut_or_push(&mut self, index: usize, zero: T) -> &mut T {
if index >= self.len() {
debug_assert!(index == self.len());
debug_assert_eq!(index, self.len());
self.push(zero)
}
&mut self[index]