Skip to content

Commit 1f1155a

Browse files
committed
Removed as_ref and the core feature.
1 parent f668a2c commit 1f1155a

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ pub trait INSArray : INSObject {
7171
fn first_object(&self) -> Option<&Self::Item> {
7272
unsafe {
7373
let obj: *const Self::Item = msg_send![self, firstObject];
74-
obj.as_ref()
74+
if obj.is_null() { None } else { Some(&*obj) }
7575
}
7676
}
7777

7878
fn last_object(&self) -> Option<&Self::Item> {
7979
unsafe {
8080
let obj: *const Self::Item = msg_send![self, lastObject];
81-
obj.as_ref()
81+
if obj.is_null() { None } else { Some(&*obj) }
8282
}
8383
}
8484

src/dictionary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait INSDictionary : INSObject {
2525
fn object_for(&self, key: &Self::Key) -> Option<&Self::Value> {
2626
unsafe {
2727
let obj: *mut Self::Value = msg_send![self, objectForKey:key];
28-
obj.as_ref()
28+
if obj.is_null() { None } else { Some(&*obj) }
2929
}
3030
}
3131

src/enumerator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<'a, T> Iterator for NSEnumerator<'a, T> where T: INSObject {
2626
fn next(&mut self) -> Option<&'a T> {
2727
unsafe {
2828
let obj: *mut T = msg_send![self.id, nextObject];
29-
obj.as_ref()
29+
if obj.is_null() { None } else { Some(&*obj) }
3030
}
3131
}
3232
}

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![crate_name = "objc_foundation"]
22
#![crate_type = "lib"]
33

4-
#![feature(core)]
5-
64
extern crate libc;
75
#[macro_use]
86
extern crate objc;

0 commit comments

Comments
 (0)