core-text: Fix some clippy warnings.
This commit is contained in:
@@ -270,12 +270,11 @@ impl CTFont {
|
||||
pub fn get_bounding_rects_for_glyphs(&self, orientation: CTFontOrientation, glyphs: &[CGGlyph])
|
||||
-> CGRect {
|
||||
unsafe {
|
||||
let result = CTFontGetBoundingRectsForGlyphs(self.as_concrete_TypeRef(),
|
||||
orientation,
|
||||
glyphs.as_ptr(),
|
||||
ptr::null_mut(),
|
||||
glyphs.len() as CFIndex);
|
||||
result
|
||||
CTFontGetBoundingRectsForGlyphs(self.as_concrete_TypeRef(),
|
||||
orientation,
|
||||
glyphs.as_ptr(),
|
||||
ptr::null_mut(),
|
||||
glyphs.len() as CFIndex)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ use core_foundation::set::CFSet;
|
||||
use core_foundation::string::{CFString, CFStringRef};
|
||||
|
||||
use libc::c_void;
|
||||
use std::ptr;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct __CTFontCollection(c_void);
|
||||
@@ -82,7 +81,7 @@ pub fn create_for_family(family: &str) -> Option<CTFontCollection> {
|
||||
let matched_descs = CTFontDescriptorCreateMatchingFontDescriptors(
|
||||
wildcard_desc.as_concrete_TypeRef(),
|
||||
mandatory_attrs.as_concrete_TypeRef());
|
||||
if matched_descs == ptr::null() {
|
||||
if matched_descs.is_null() {
|
||||
return None;
|
||||
}
|
||||
let matched_descs = CFArray::wrap_under_create_rule(matched_descs);
|
||||
|
||||
@@ -93,23 +93,23 @@ impl StylisticClassAccessors for CTFontStylisticClass {
|
||||
| kCTFontSlabSerifsClass
|
||||
| kCTFontFreeformSerifsClass;
|
||||
|
||||
return (*self & any_serif_class) != 0;
|
||||
(*self & any_serif_class) != 0
|
||||
}
|
||||
|
||||
fn is_sans_serif(&self) -> bool {
|
||||
return (*self & kCTFontSansSerifClass) != 0;
|
||||
(*self & kCTFontSansSerifClass) != 0
|
||||
}
|
||||
|
||||
fn is_script(&self) -> bool {
|
||||
return (*self & kCTFontScriptsClass) != 0;
|
||||
(*self & kCTFontScriptsClass) != 0
|
||||
}
|
||||
|
||||
fn is_fantasy(&self) -> bool {
|
||||
return (*self & kCTFontOrnamentalsClass) != 0;
|
||||
(*self & kCTFontOrnamentalsClass) != 0
|
||||
}
|
||||
|
||||
fn is_symbols(&self) -> bool {
|
||||
return (*self & kCTFontSymbolicClass) != 0;
|
||||
(*self & kCTFontSymbolicClass) != 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user