File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -113,4 +113,6 @@ jobs:
113
113
uses : actions-rs/cargo@v1
114
114
with :
115
115
command : test
116
- args : --verbose --no-fail-fast
116
+ # TODO: `objc/exception` feature is broken in objc_foundation
117
+ # TODO: `objc_foundation/block` feature doesn't work on GNUStep
118
+ args : --verbose --no-fail-fast --no-default-features
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ license = "MIT"
12
12
13
13
exclude = [" .gitignore" ]
14
14
15
+ [features ]
16
+ default = [" block" ]
17
+
15
18
[dependencies ]
16
- block = " 0.1"
19
+ block = { optional = true , version = " 0.1" }
17
20
objc = { path = " ../objc" , version = " 0.2.7" }
18
21
objc_id = { path = " ../objc_id" , version = " 0.1" }
Original file line number Diff line number Diff line change 1
- use std:: mem;
2
1
use std:: ops:: Range ;
3
2
use std:: os:: raw:: c_void;
4
3
use std:: slice;
5
4
6
5
use super :: { INSCopying , INSMutableCopying , INSObject , NSRange } ;
6
+ #[ cfg( feature = "block" ) ]
7
7
use block:: { Block , ConcreteBlock } ;
8
8
use objc:: msg_send;
9
9
use objc_id:: Id ;
@@ -39,6 +39,7 @@ pub trait INSData: INSObject {
39
39
}
40
40
}
41
41
42
+ #[ cfg( feature = "block" ) ]
42
43
fn from_vec ( bytes : Vec < u8 > ) -> Id < Self > {
43
44
let capacity = bytes. capacity ( ) ;
44
45
let dealloc = ConcreteBlock :: new ( move |bytes : * mut c_void , len : usize | unsafe {
@@ -56,7 +57,7 @@ pub trait INSData: INSObject {
56
57
let obj: * mut Self = msg_send ! [ obj, initWithBytesNoCopy: bytes_ptr
57
58
length: bytes. len( )
58
59
deallocator: dealloc] ;
59
- mem:: forget ( bytes) ;
60
+ std :: mem:: forget ( bytes) ;
60
61
Id :: from_retained_ptr ( obj)
61
62
}
62
63
}
@@ -192,6 +193,7 @@ mod tests {
192
193
assert ! ( data. bytes( ) == [ 8 , 17 ] ) ;
193
194
}
194
195
196
+ #[ cfg( feature = "block" ) ]
195
197
#[ test]
196
198
fn test_from_vec ( ) {
197
199
let bytes = vec ! [ 3 , 7 , 16 ] ;
You can’t perform that action at this time.
0 commit comments