Skip to content

Commit 0eda34d

Browse files
committed
Silence deprecation warnings for now
1 parent 170dcce commit 0eda34d

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

cocoa-foundation/src/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
use objc2::runtime;
1111

12-
pub use objc2::runtime::{BOOL, NO, YES};
12+
pub type BOOL = runtime::BOOL;
13+
pub const NO: BOOL = runtime::NO;
14+
pub const YES: BOOL = runtime::YES;
1315

1416
pub type Class = *mut runtime::Class;
1517
#[allow(non_camel_case_types)]

cocoa-foundation/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// except according to those terms.
99

1010
#![allow(non_snake_case)]
11+
#![allow(deprecated)] // TODO(madsmtm): Remove this
1112

1213
extern crate block2;
1314
#[macro_use]

cocoa/examples/fullscreen.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
extern crate cocoa;
22
extern crate core_graphics;
3-
4-
#[macro_use]
53
extern crate objc2;
64

75
use cocoa::appkit::{
@@ -17,8 +15,9 @@ use cocoa::foundation::{
1715

1816
use core_graphics::display::CGDisplay;
1917

20-
use objc2::declare::ClassDecl;
18+
use objc2::declare::ClassBuilder;
2119
use objc2::runtime::{Object, Sel};
20+
use objc2::{class, msg_send, sel};
2221

2322
fn main() {
2423
unsafe {
@@ -48,7 +47,7 @@ fn main() {
4847

4948
// Create NSWindowDelegate
5049
let superclass = class!(NSObject);
51-
let mut decl = ClassDecl::new("MyWindowDelegate", superclass).unwrap();
50+
let mut decl = ClassBuilder::new("MyWindowDelegate", superclass).unwrap();
5251

5352
extern "C" fn will_use_fillscreen_presentation_options(
5453
_: &Object,

cocoa/examples/nsvisualeffectview_blur.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern crate cocoa;
22
extern crate objc2;
33

44
use cocoa::base::{nil, selector, NO};
5-
use objc2::*;
5+
use objc2::msg_send;
66

77
use cocoa::appkit::{
88
NSApp, NSApplication, NSApplicationActivationPolicyRegular, NSBackingStoreType, NSColor,

cocoa/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![crate_name = "cocoa"]
1111
#![crate_type = "rlib"]
1212
#![allow(non_snake_case)]
13+
#![allow(deprecated)] // TODO(madsmtm): Remove this
1314

1415
extern crate block2;
1516
#[macro_use]

0 commit comments

Comments
 (0)