@@ -18,7 +18,7 @@ use core_foundation::base::kCFAllocatorDefault;
18
18
use core_foundation:: dictionary:: CFDictionary ;
19
19
use core_foundation:: string:: { CFString , CFStringRef } ;
20
20
21
- use dynamic_store:: { SCDynamicStoreBuilder , SCDynamicStore } ;
21
+ use dynamic_store:: { SCDynamicStore , SCDynamicStoreBuilder } ;
22
22
pub use system_configuration_sys:: network_configuration:: * ;
23
23
use system_configuration_sys:: preferences:: SCPreferencesCreate ;
24
24
@@ -60,7 +60,7 @@ impl SCNetworkServiceDns {
60
60
setup_server_addresses : server_addresses. 1 ,
61
61
}
62
62
}
63
-
63
+
64
64
/// Returns DomainName (state and setup)
65
65
pub fn domain_name ( & self ) -> ( Option < String > , Option < String > ) {
66
66
(
@@ -108,17 +108,17 @@ pub fn global_router(store: &SCDynamicStore) -> Option<IpAddr> {
108
108
return None ;
109
109
}
110
110
111
- // pub fn netinfo(&self);
112
- // pub fn proxies(&self) ;
113
-
114
111
115
112
declare_TCFType ! {
116
113
/// Network service object.
117
114
SCNetworkService , SCNetworkServiceRef
118
115
}
119
116
120
- impl_TCFType ! ( SCNetworkService , SCNetworkServiceRef , SCNetworkServiceGetTypeID ) ;
121
-
117
+ impl_TCFType ! (
118
+ SCNetworkService ,
119
+ SCNetworkServiceRef ,
120
+ SCNetworkServiceGetTypeID
121
+ ) ;
122
122
123
123
124
124
impl SCNetworkService {
@@ -152,11 +152,7 @@ impl SCNetworkService {
152
152
array
153
153
. get_all_values ( )
154
154
. iter ( )
155
- . map ( |service_ptr| {
156
- unsafe {
157
- SCNetworkService :: wrap_under_get_rule ( * service_ptr as _ )
158
- }
159
- } )
155
+ . map ( |service_ptr| unsafe { SCNetworkService :: wrap_under_get_rule ( * service_ptr as _ ) } )
160
156
. collect :: < Vec < SCNetworkService > > ( )
161
157
}
162
158
@@ -178,7 +174,8 @@ impl SCNetworkService {
178
174
let mut services = Vec :: new ( ) ;
179
175
180
176
for id_ptr in array. get_all_values ( ) . iter ( ) {
181
- let service_ptr: SCNetworkServiceRef = unsafe { SCNetworkServiceCopy ( prefs, * id_ptr as _ ) } ;
177
+ let service_ptr: SCNetworkServiceRef =
178
+ unsafe { SCNetworkServiceCopy ( prefs, * id_ptr as _ ) } ;
182
179
services. push ( unsafe { SCNetworkService :: wrap_under_get_rule ( service_ptr) } ) ;
183
180
}
184
181
@@ -330,7 +327,11 @@ declare_TCFType!{
330
327
SCNetworkInterface , SCNetworkInterfaceRef
331
328
}
332
329
333
- impl_TCFType ! ( SCNetworkInterface , SCNetworkInterfaceRef , SCNetworkInterfaceGetTypeID ) ;
330
+ impl_TCFType ! (
331
+ SCNetworkInterface ,
332
+ SCNetworkInterfaceRef ,
333
+ SCNetworkInterfaceGetTypeID
334
+ ) ;
334
335
335
336
336
337
impl SCNetworkInterface {
@@ -357,10 +358,8 @@ impl SCNetworkInterface {
357
358
array
358
359
. get_all_values ( )
359
360
. iter ( )
360
- . map ( |interface_ptr| {
361
- unsafe {
362
- SCNetworkInterface :: wrap_under_get_rule ( * interface_ptr as _ )
363
- }
361
+ . map ( |interface_ptr| unsafe {
362
+ SCNetworkInterface :: wrap_under_get_rule ( * interface_ptr as _ )
364
363
} )
365
364
. collect :: < Vec < SCNetworkInterface > > ( )
366
365
}
0 commit comments