Skip to content

Commit cbf991e

Browse files
author
Nabil Elqatib
committed
Merge remote-tracking branch 'upstream/master'
2 parents 54d1b93 + c6d7268 commit cbf991e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

cocoa-foundation/src/foundation.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,8 @@ pub trait NSProcessInfo: Sized {
229229
msg_send![class!(NSProcessInfo), processInfo]
230230
}
231231

232-
unsafe fn systemUptime(_: Self) -> NSTimeInterval {
233-
msg_send![class!(NSProcessInfo), systemUptime]
234-
}
235-
232+
unsafe fn systemUptime(self) -> NSTimeInterval;
236233
unsafe fn processName(self) -> id;
237-
unsafe fn uptime(self) -> NSTimeInterval;
238234
unsafe fn operatingSystemVersion(self) -> NSOperatingSystemVersion;
239235
unsafe fn isOperatingSystemAtLeastVersion(self, version: NSOperatingSystemVersion) -> bool;
240236
}
@@ -244,7 +240,7 @@ impl NSProcessInfo for id {
244240
msg_send![self, processName]
245241
}
246242

247-
unsafe fn uptime(self) -> NSTimeInterval {
243+
unsafe fn systemUptime(self) -> NSTimeInterval {
248244
msg_send![self, systemUptime]
249245
}
250246

core-foundation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["macos", "framework", "objc"]
1111

1212
[dependencies.core-foundation-sys]
1313
path = "../core-foundation-sys"
14-
version = "0.8.0"
14+
version = "0.8.3"
1515

1616
[dependencies]
1717
libc = "0.2"

core-text/src/font.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ fn macos_version() -> (i32, i32, i32) {
691691

692692
#[test]
693693
fn copy_system_font() {
694+
use crate::*;
695+
694696
let small = unsafe {
695697
CTFont::wrap_under_create_rule(
696698
CTFontCreateUIFontForLanguage(kCTFontSystemDetailFontType, 19., std::ptr::null())
@@ -712,6 +714,12 @@ fn copy_system_font() {
712714
let ctfont = new_from_descriptor(&desc, 20.);
713715
assert_eq!(big.postscript_name(), ctfont.postscript_name());
714716

717+
// check that we can construct a new version by attributes
718+
let attr = desc.attributes();
719+
let desc_from_attr = font_descriptor::new_from_attributes(&attr);
720+
let font_from_attr = new_from_descriptor(&desc_from_attr, 19.);
721+
assert_eq!(font_from_attr.postscript_name(), small.postscript_name());
722+
715723
// on newer versions of macos we can't construct by name anymore
716724
if macos_version() < (10, 13, 0) {
717725
let ui_font_by_name = new_from_name(&small.postscript_name(), 19.).unwrap();

0 commit comments

Comments
 (0)