clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674)

This commit is contained in:
Martin Robinson 2024-07-04 16:18:58 +02:00 committed by GitHub
parent 99c1f886b8
commit 4b63043c6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 72 additions and 78 deletions

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::convert::TryInto;
use std::os::raw::c_long;
use std::sync::Arc;
use std::{mem, ptr};
@ -106,12 +105,11 @@ fn create_face(data: Arc<Vec<u8>>, face_index: u32) -> Result<FT_Face, &'static
let library = FreeTypeLibraryHandle::get().lock();
// This is to support 32bit Android where FT_Long is defined as i32.
let face_index = face_index.try_into().unwrap();
let result = FT_New_Memory_Face(
library.freetype_library,
data.as_ptr(),
data.len() as FT_Long,
face_index,
face_index as FT_Long,
&mut face,
);