Auto merge of #19970 - janczer:change_debug_assertions, r=emilio

Change debug assertions to specific ones

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19962 (github issue number if applicable).

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/19970)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-07 06:20:36 -05:00 committed by GitHub
commit 5d209a70ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 53 additions and 53 deletions

View file

@ -291,7 +291,7 @@ fn split_at_utf16_code_unit_offset(s: &str, offset: u32) -> Result<(&str, Option
if c > '\u{FFFF}' {
if code_units == offset {
if opts::get().replace_surrogates {
debug_assert!(c.len_utf8() == 4);
debug_assert_eq!(c.len_utf8(), 4);
return Ok((&s[..i], Some(c), &s[i + c.len_utf8()..]))
}
panic!("\n\n\

View file

@ -1334,7 +1334,7 @@ impl TreeIterator {
}
self.depth -= 1;
}
debug_assert!(self.depth == 0);
debug_assert_eq!(self.depth, 0);
self.current = None;
Some(current)
}

View file

@ -313,7 +313,7 @@ impl WebGLTexture {
}
fn is_cube_complete(&self) -> bool {
debug_assert!(self.face_count.get() == 6);
debug_assert_eq!(self.face_count.get(), 6);
let image_info = self.base_image_info().unwrap();
if !image_info.is_defined() {