More clippy fixes. (#629)

This commit is contained in:
Bruce Mitchener
2023-08-08 00:42:26 +07:00
committed by GitHub
parent 855319c0e2
commit b6d2529ca9
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -387,7 +387,7 @@ impl CTFont {
advances: *mut CGSize,
count: CFIndex,
) -> f64 {
CTFontGetAdvancesForGlyphs(self.0, orientation, glyphs, advances, count) as f64
CTFontGetAdvancesForGlyphs(self.0, orientation, glyphs, advances, count)
}
pub unsafe fn get_vertical_translations_for_glyphs(
@@ -980,8 +980,8 @@ fn equal_descriptor_different_font() {
// but we can still construct the CGFont by name
let create_vars = |desc| {
let mut vals: Vec<(CFNumber, CFNumber)> = Vec::new();
vals.push((CFNumber::from(0x6f70737a), CFNumber::from(17.)));
let vals: Vec<(CFNumber, CFNumber)> =
vec![(CFNumber::from(0x6f70737a), CFNumber::from(17.))];
let vals_dict = CFDictionary::from_CFType_pairs(&vals);
let attrs_dict =
CFDictionary::from_CFType_pairs(&[(variation_attribute.clone(), vals_dict)]);
@@ -1081,8 +1081,8 @@ fn system_font_variation() {
let cgfont = new_from_CGFont(&cgfont, 0.);
let desc = cgfont.copy_descriptor();
let mut vals: Vec<(CFNumber, CFNumber)> = Vec::new();
vals.push((CFNumber::from(0x6f70737a /* opsz */), CFNumber::from(17.)));
let vals: Vec<(CFNumber, CFNumber)> =
vec![(CFNumber::from(0x6f70737a /* opsz */), CFNumber::from(17.))];
let vals_dict = CFDictionary::from_CFType_pairs(&vals);
let variation_attribute =
unsafe { CFString::wrap_under_get_rule(font_descriptor::kCTFontVariationAttribute) };
+1 -1
View File
@@ -155,7 +155,7 @@ impl IOSurface {
let height = IOSurfaceGetHeight(surface);
let stride = IOSurfaceGetBytesPerRow(surface);
let size = (height * stride) as usize;
let size = height * stride;
let address = IOSurfaceGetBaseAddress(surface) as *mut u8;
let dest: &mut [u8] = slice::from_raw_parts_mut(address, size);
dest.clone_from_slice(data);