Skip to content

Commit

Permalink
rustfmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfkthame authored Sep 19, 2023
1 parent 91fb8c3 commit b7e7de2
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions core-text/src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ pub fn new_from_descriptor(desc: &CTFontDescriptor, pt_size: f64) -> CTFont {
}
}

pub fn new_from_descriptor_and_options(desc: &CTFontDescriptor, pt_size: f64, options: CTFontOptions) -> CTFont {
pub fn new_from_descriptor_and_options(
desc: &CTFontDescriptor,
pt_size: f64,
options: CTFontOptions,
) -> CTFont {
unsafe {
let font_ref = CTFontCreateWithFontDescriptorAndOptions(
desc.as_concrete_TypeRef(),
Expand Down Expand Up @@ -210,11 +214,19 @@ pub fn new_from_name(name: &str, pt_size: f64) -> Result<CTFont, ()> {
}
}

pub fn new_from_name_and_options(name: &str, pt_size: f64, options: CTFontOptions) -> Result<CTFont, ()> {
pub fn new_from_name_and_options(
name: &str,
pt_size: f64,
options: CTFontOptions,
) -> Result<CTFont, ()> {
unsafe {
let name: CFString = name.parse().unwrap();
let font_ref =
CTFontCreateWithNameAndOptions(name.as_concrete_TypeRef(), pt_size as CGFloat, ptr::null(), options);
let font_ref = CTFontCreateWithNameAndOptions(
name.as_concrete_TypeRef(),
pt_size as CGFloat,
ptr::null(),
options,
);
if font_ref.is_null() {
Err(())
} else {
Expand Down

0 comments on commit b7e7de2

Please sign in to comment.