diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-01-25 18:06:33 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 18:06:33 -0600 |
commit | c9ba16f9fbdf7f43cb19feedfaaa68c85bbcbe3b (patch) | |
tree | b6b5d9e1539d294fdbba5fec5a545d8aa6552443 /components/gfx | |
parent | fc3b1789318afc8f10e160d40b592234fbdb5cf4 (diff) | |
parent | 31631cdc47618a1591b6520eab8c82b28ac13bee (diff) | |
download | servo-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/gfx')
-rw-r--r-- | components/gfx/platform/freetype/font.rs | 2 | ||||
-rw-r--r-- | components/gfx/platform/freetype/font_list.rs | 2 | ||||
-rw-r--r-- | components/gfx/platform/macos/font.rs | 2 | ||||
-rw-r--r-- | components/gfx/text/shaping/harfbuzz.rs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index 112fc285b59..a7dd652b9f5 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -322,7 +322,7 @@ impl<'a> FontHandle { let x_scale = (metrics.x_ppem as f64) / em_size as f64; // If this isn't true then we're scaling one of the axes wrong - assert!(metrics.x_ppem == metrics.y_ppem); + assert_eq!(metrics.x_ppem, metrics.y_ppem); Au::from_f64_px(value * x_scale) } diff --git a/components/gfx/platform/freetype/font_list.rs b/components/gfx/platform/freetype/font_list.rs index c4f0cfe4fec..9b85db624d8 100644 --- a/components/gfx/platform/freetype/font_list.rs +++ b/components/gfx/platform/freetype/font_list.rs @@ -63,7 +63,7 @@ pub fn for_each_variation<F>(family_name: &str, mut callback: F) let family_name_c = CString::new(family_name).unwrap(); let family_name = family_name_c.as_ptr(); let ok = FcPatternAddString(pattern, FC_FAMILY.as_ptr() as *mut c_char, family_name as *mut FcChar8); - assert!(ok != 0); + assert_ne!(ok, 0); let object_set = FcObjectSetCreate(); assert!(!object_set.is_null()); diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index beb8f9f4f2f..b14d30e6cca 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -247,7 +247,7 @@ impl FontHandleMethods for FontHandle { return None; } - assert!(glyphs[0] != 0); // FIXME: error handling + assert_ne!(glyphs[0], 0); // FIXME: error handling return Some(glyphs[0] as GlyphId); } diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index 36e35150ad1..c1b25e42d9b 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -64,7 +64,7 @@ impl ShapedGlyphData { let mut pos_count = 0; let pos_infos = hb_buffer_get_glyph_positions(buffer, &mut pos_count); assert!(!pos_infos.is_null()); - assert!(glyph_count == pos_count); + assert_eq!(glyph_count, pos_count); ShapedGlyphData { count: glyph_count as usize, |