18
18
let cls = D :: class ( ) ;
19
19
let count = min ( keys. len ( ) , vals. len ( ) ) ;
20
20
let obj: * mut D = msg_send ! [ cls, alloc] ;
21
- let obj: * mut D = msg_send ! [ obj, initWithObjects: vals. as_ptr( )
22
- forKeys: keys. as_ptr( )
23
- count: count] ;
21
+ let obj: * mut D = msg_send ! [
22
+ obj,
23
+ initWithObjects: vals. as_ptr( ) ,
24
+ forKeys: keys. as_ptr( ) ,
25
+ count: count,
26
+ ] ;
24
27
Id :: new ( NonNull :: new_unchecked ( obj) )
25
28
}
26
29
@@ -48,8 +51,11 @@ pub trait INSDictionary: INSObject {
48
51
let len = self . count ( ) ;
49
52
let mut keys = Vec :: with_capacity ( len) ;
50
53
unsafe {
51
- let _: ( ) = msg_send ! [ self , getObjects: ptr:: null_mut:: <& Self :: Value >( )
52
- andKeys: keys. as_mut_ptr( ) ] ;
54
+ let _: ( ) = msg_send ! [
55
+ self ,
56
+ getObjects: ptr:: null_mut:: <& Self :: Value >( ) ,
57
+ andKeys: keys. as_mut_ptr( ) ,
58
+ ] ;
53
59
keys. set_len ( len) ;
54
60
}
55
61
keys
@@ -59,8 +65,11 @@ pub trait INSDictionary: INSObject {
59
65
let len = self . count ( ) ;
60
66
let mut vals = Vec :: with_capacity ( len) ;
61
67
unsafe {
62
- let _: ( ) = msg_send ! [ self , getObjects: vals. as_mut_ptr( )
63
- andKeys: ptr:: null_mut:: <& Self :: Key >( ) ] ;
68
+ let _: ( ) = msg_send ! [
69
+ self ,
70
+ getObjects: vals. as_mut_ptr( ) ,
71
+ andKeys: ptr:: null_mut:: <& Self :: Key >( ) ,
72
+ ] ;
64
73
vals. set_len ( len) ;
65
74
}
66
75
vals
@@ -71,8 +80,11 @@ pub trait INSDictionary: INSObject {
71
80
let mut keys = Vec :: with_capacity ( len) ;
72
81
let mut objs = Vec :: with_capacity ( len) ;
73
82
unsafe {
74
- let _: ( ) = msg_send ! [ self , getObjects: objs. as_mut_ptr( )
75
- andKeys: keys. as_mut_ptr( ) ] ;
83
+ let _: ( ) = msg_send ! [
84
+ self ,
85
+ getObjects: objs. as_mut_ptr( ) ,
86
+ andKeys: keys. as_mut_ptr( ) ,
87
+ ] ;
76
88
keys. set_len ( len) ;
77
89
objs. set_len ( len) ;
78
90
}
@@ -100,7 +112,10 @@ pub trait INSDictionary: INSObject {
100
112
}
101
113
}
102
114
103
- fn from_keys_and_objects < T > ( keys : & [ & T ] , vals : Vec < Id < Self :: Value , Self :: Own > > ) -> Id < Self , Owned >
115
+ fn from_keys_and_objects < T > (
116
+ keys : & [ & T ] ,
117
+ vals : Vec < Id < Self :: Value , Self :: Own > > ,
118
+ ) -> Id < Self , Owned >
104
119
where
105
120
T : INSCopying < Output = Self :: Key > ,
106
121
{
@@ -166,7 +181,7 @@ where
166
181
#[ cfg( test) ]
167
182
mod tests {
168
183
use alloc:: vec;
169
- use objc2:: rc:: { Owned , Id } ;
184
+ use objc2:: rc:: { Id , Owned } ;
170
185
171
186
use super :: { INSDictionary , NSDictionary } ;
172
187
use crate :: { INSArray , INSObject , INSString , NSObject , NSString } ;
0 commit comments