Skip to content

Commit 8019dd7

Browse files
committed
clippy fixes + comment out CORETEXT flag to make it compile on aarch64
1 parent f4d5417 commit 8019dd7

File tree

6 files changed

+13
-22
lines changed

6 files changed

+13
-22
lines changed

build.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ fn main() {
1010
let target = env::var("TARGET").unwrap();
1111

1212
println!("cargo:rerun-if-env-changed=HARFBUZZ_SYS_NO_PKG_CONFIG");
13-
if target.contains("wasm32") || env::var_os("HARFBUZZ_SYS_NO_PKG_CONFIG").is_none() {
14-
if pkg_config::probe_library("harfbuzz").is_ok() {
15-
return;
16-
}
13+
if (target.contains("wasm32") || env::var_os("HARFBUZZ_SYS_NO_PKG_CONFIG").is_none())
14+
&& pkg_config::probe_library("harfbuzz").is_ok()
15+
{
16+
return;
1717
}
1818

1919
let mut cfg = cc::Build::new();
@@ -27,9 +27,9 @@ fn main() {
2727
cfg.define("HAVE_PTHREAD", "1");
2828
}
2929

30-
if target.contains("apple") {
31-
cfg.define("HAVE_CORETEXT", "1");
32-
}
30+
// if target.contains("apple") {
31+
// cfg.define("HAVE_CORETEXT", "1");
32+
// }
3333

3434
if target.contains("windows-gnu") {
3535
cfg.flag("-Wa,-mbig-obj");

src/blob.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::os::raw::c_void;
22

3-
use std;
43
use std::marker::PhantomData;
54

65
use std::fmt;
@@ -89,7 +88,7 @@ impl<'a> Blob<'a> {
8988
let data = Box::into_raw(boxxed);
9089

9190
extern "C" fn destroy<U>(ptr: *mut c_void) {
92-
unsafe { Box::from_raw(ptr as *mut U) };
91+
_ = unsafe { Box::from_raw(ptr as *mut U) };
9392
}
9493

9594
let hb_blob = unsafe {

src/buffer.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ impl GlyphInfo {
159159
}
160160
}
161161

162-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
162+
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash)]
163163
pub enum ClusterLevel {
164+
#[default]
164165
MonotoneGraphemes,
165166
MonotoneCharacters,
166167
Characters,
@@ -185,12 +186,6 @@ impl ClusterLevel {
185186
}
186187
}
187188

188-
impl Default for ClusterLevel {
189-
fn default() -> Self {
190-
ClusterLevel::MonotoneGraphemes
191-
}
192-
}
193-
194189
#[derive(Debug)]
195190
pub(crate) struct GenericBuffer {
196191
raw: NonNull<hb_buffer_t>,

src/common.rs

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ pub enum TagFromStrErr {
112112
ZeroLengthString,
113113
}
114114

115-
use std;
116115
use std::str::FromStr;
117116

118117
impl FromStr for Tag {

src/face.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std;
21
use std::os::raw::c_void;
32
use std::ptr::NonNull;
43

@@ -56,7 +55,7 @@ impl<'a> Face<'a> {
5655

5756
/// Create a face from the bytes of a given slice and an index specifying
5857
/// which font to read from an OpenType font collection.
59-
pub fn from_bytes<'b>(bytes: &'b [u8], index: u32) -> Owned<Face<'b>> {
58+
pub fn from_bytes(bytes: &[u8], index: u32) -> Owned<Face<'_>> {
6059
let blob = Blob::with_bytes(bytes);
6160
Face::new(blob, index)
6261
}
@@ -68,7 +67,7 @@ impl<'a> Face<'a> {
6867
F: 'b + Send + Sync + FnMut(Tag) -> Option<Shared<Blob<'b>>>,
6968
{
7069
extern "C" fn destroy_box<U>(ptr: *mut c_void) {
71-
unsafe { Box::from_raw(ptr as *mut U) };
70+
_ = unsafe { Box::from_raw(ptr as *mut U) };
7271
}
7372
extern "C" fn table_func<'b, F>(
7473
_: *mut hb_face_t,

src/font.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std;
21
use std::ptr::NonNull;
32

43
use std::os::raw::c_void;
@@ -58,7 +57,7 @@ impl FontExtents {
5857
pub type GlyphExtents = hb_glyph_extents_t;
5958

6059
pub(crate) extern "C" fn destroy_box<U>(ptr: *mut c_void) {
61-
unsafe { Box::from_raw(ptr as *mut U) };
60+
_ = unsafe { Box::from_raw(ptr as *mut U) };
6261
}
6362

6463
/// A type representing a single font (i.e. a specific combination of typeface,

0 commit comments

Comments
 (0)