File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -113,4 +113,6 @@ jobs:
113113 uses : actions-rs/cargo@v1
114114 with :
115115 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"
1212
1313exclude = [" .gitignore" ]
1414
15+ [features ]
16+ default = [" block" ]
17+
1518[dependencies ]
16- block = " 0.1"
19+ block = { optional = true , version = " 0.1" }
1720objc = { path = " ../objc" , version = " 0.2.7" }
1821objc_id = { path = " ../objc_id" , version = " 0.1" }
Original file line number Diff line number Diff line change 1- use std:: mem;
21use std:: ops:: Range ;
32use std:: os:: raw:: c_void;
43use std:: slice;
54
65use super :: { INSCopying , INSMutableCopying , INSObject , NSRange } ;
6+ #[ cfg( feature = "block" ) ]
77use block:: { Block , ConcreteBlock } ;
88use objc:: msg_send;
99use objc_id:: Id ;
@@ -39,6 +39,7 @@ pub trait INSData: INSObject {
3939 }
4040 }
4141
42+ #[ cfg( feature = "block" ) ]
4243 fn from_vec ( bytes : Vec < u8 > ) -> Id < Self > {
4344 let capacity = bytes. capacity ( ) ;
4445 let dealloc = ConcreteBlock :: new ( move |bytes : * mut c_void , len : usize | unsafe {
@@ -56,7 +57,7 @@ pub trait INSData: INSObject {
5657 let obj: * mut Self = msg_send ! [ obj, initWithBytesNoCopy: bytes_ptr
5758 length: bytes. len( )
5859 deallocator: dealloc] ;
59- mem:: forget ( bytes) ;
60+ std :: mem:: forget ( bytes) ;
6061 Id :: from_retained_ptr ( obj)
6162 }
6263 }
@@ -192,6 +193,7 @@ mod tests {
192193 assert ! ( data. bytes( ) == [ 8 , 17 ] ) ;
193194 }
194195
196+ #[ cfg( feature = "block" ) ]
195197 #[ test]
196198 fn test_from_vec ( ) {
197199 let bytes = vec ! [ 3 , 7 , 16 ] ;
You can’t perform that action at this time.
0 commit comments