Skip to content

Commit f275ef6

Browse files
committed
Added an Any bound to INSObject.
This is necessary because an Any bound was added on the return type of msg_send! in objc 0.1.6.
1 parent 47048ed commit f275ef6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/object.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::any::Any;
2+
13
use objc::Message;
24
use objc::runtime::{BOOL, Class, NO};
35
use objc_id::{Id, ShareId};
@@ -10,7 +12,7 @@ use NSString;
1012
pointer to an Object pointer, because dynamically-sized types can have fat
1113
pointers (two words) instead of real pointers.
1214
*/
13-
pub trait INSObject : 'static + Sized + Message {
15+
pub trait INSObject : Any + Sized + Message {
1416
fn class() -> &'static Class;
1517

1618
fn hash_code(&self) -> usize {

src/value.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::any::Any;
12
use std::ffi::{CStr, CString};
23
use std::marker::PhantomData;
34
use std::mem;
@@ -49,17 +50,17 @@ pub struct NSValue<T> {
4950

5051
object_impl!(NSValue<T>);
5152

52-
impl<T> INSObject for NSValue<T> where T: 'static {
53+
impl<T> INSObject for NSValue<T> where T: Any {
5354
fn class() -> &'static Class {
5455
Class::get("NSValue").unwrap()
5556
}
5657
}
5758

58-
impl<T> INSValue for NSValue<T> where T: 'static + Copy + Encode {
59+
impl<T> INSValue for NSValue<T> where T: Any + Copy + Encode {
5960
type Value = T;
6061
}
6162

62-
impl<T> INSCopying for NSValue<T> where T: 'static {
63+
impl<T> INSCopying for NSValue<T> where T: Any {
6364
type Output = NSValue<T>;
6465
}
6566

0 commit comments

Comments
 (0)