Skip to content

Commit b6d2529

Browse files
More clippy fixes. (#629)
1 parent 855319c commit b6d2529

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core-text/src/font.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl CTFont {
387387
advances: *mut CGSize,
388388
count: CFIndex,
389389
) -> f64 {
390-
CTFontGetAdvancesForGlyphs(self.0, orientation, glyphs, advances, count) as f64
390+
CTFontGetAdvancesForGlyphs(self.0, orientation, glyphs, advances, count)
391391
}
392392

393393
pub unsafe fn get_vertical_translations_for_glyphs(
@@ -980,8 +980,8 @@ fn equal_descriptor_different_font() {
980980

981981
// but we can still construct the CGFont by name
982982
let create_vars = |desc| {
983-
let mut vals: Vec<(CFNumber, CFNumber)> = Vec::new();
984-
vals.push((CFNumber::from(0x6f70737a), CFNumber::from(17.)));
983+
let vals: Vec<(CFNumber, CFNumber)> =
984+
vec![(CFNumber::from(0x6f70737a), CFNumber::from(17.))];
985985
let vals_dict = CFDictionary::from_CFType_pairs(&vals);
986986
let attrs_dict =
987987
CFDictionary::from_CFType_pairs(&[(variation_attribute.clone(), vals_dict)]);
@@ -1081,8 +1081,8 @@ fn system_font_variation() {
10811081
let cgfont = new_from_CGFont(&cgfont, 0.);
10821082
let desc = cgfont.copy_descriptor();
10831083

1084-
let mut vals: Vec<(CFNumber, CFNumber)> = Vec::new();
1085-
vals.push((CFNumber::from(0x6f70737a /* opsz */), CFNumber::from(17.)));
1084+
let vals: Vec<(CFNumber, CFNumber)> =
1085+
vec![(CFNumber::from(0x6f70737a /* opsz */), CFNumber::from(17.))];
10861086
let vals_dict = CFDictionary::from_CFType_pairs(&vals);
10871087
let variation_attribute =
10881088
unsafe { CFString::wrap_under_get_rule(font_descriptor::kCTFontVariationAttribute) };

io-surface/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl IOSurface {
155155

156156
let height = IOSurfaceGetHeight(surface);
157157
let stride = IOSurfaceGetBytesPerRow(surface);
158-
let size = (height * stride) as usize;
158+
let size = height * stride;
159159
let address = IOSurfaceGetBaseAddress(surface) as *mut u8;
160160
let dest: &mut [u8] = slice::from_raw_parts_mut(address, size);
161161
dest.clone_from_slice(data);

0 commit comments

Comments
 (0)