@@ -44,7 +44,7 @@ impl Path {
44
44
pub fn uses_interface_type ( & self , interface_type : InterfaceType ) -> bool {
45
45
unsafe {
46
46
sys:: nw_path_uses_interface_type ( self . inner . as_mut_ptr ( ) , interface_type. as_raw ( ) )
47
- == Bool :: YES
47
+ . as_bool ( )
48
48
}
49
49
}
50
50
@@ -90,34 +90,34 @@ impl Path {
90
90
91
91
/// Checks whether the path can route IPv4 traffic.
92
92
pub fn supports_ipv4 ( & self ) -> bool {
93
- unsafe { sys:: nw_path_has_ipv4 ( self . inner . as_mut_ptr ( ) ) == Bool :: YES }
93
+ unsafe { sys:: nw_path_has_ipv4 ( self . inner . as_mut_ptr ( ) ) . as_bool ( ) }
94
94
}
95
95
96
96
/// Checks whether the path can route IPv6 traffic.
97
97
pub fn supports_ipv6 ( & self ) -> bool {
98
- unsafe { sys:: nw_path_has_ipv6 ( self . inner . as_mut_ptr ( ) ) == Bool :: YES }
98
+ unsafe { sys:: nw_path_has_ipv6 ( self . inner . as_mut_ptr ( ) ) . as_bool ( ) }
99
99
}
100
100
101
101
/// Checks whether the path has a DNS server configured.
102
102
pub fn supports_dns ( & self ) -> bool {
103
- unsafe { sys:: nw_path_has_dns ( self . inner . as_mut_ptr ( ) ) == Bool :: YES }
103
+ unsafe { sys:: nw_path_has_dns ( self . inner . as_mut_ptr ( ) ) . as_bool ( ) }
104
104
}
105
105
106
106
/// Checks whether the path uses an interface in Low Data Mode.
107
107
pub fn is_constrained ( & self ) -> bool {
108
- unsafe { sys:: nw_path_is_constrained ( self . inner . as_mut_ptr ( ) ) == Bool :: YES }
108
+ unsafe { sys:: nw_path_is_constrained ( self . inner . as_mut_ptr ( ) ) . as_bool ( ) }
109
109
}
110
110
111
111
/// Checks whether the path uses an interface that is considered expensive, such as Cellular or a Personal Hotspot.
112
112
pub fn is_expensive ( & self ) -> bool {
113
- unsafe { sys:: nw_path_is_expensive ( self . inner . as_mut_ptr ( ) ) == Bool :: YES }
113
+ unsafe { sys:: nw_path_is_expensive ( self . inner . as_mut_ptr ( ) ) . as_bool ( ) }
114
114
}
115
115
}
116
116
117
117
impl PartialEq for Path {
118
118
fn eq ( & self , other : & Self ) -> bool {
119
119
unsafe {
120
- sys:: nw_path_is_equal ( self . inner . as_mut_ptr ( ) , other. inner . as_mut_ptr ( ) ) == Bool :: YES
120
+ sys:: nw_path_is_equal ( self . inner . as_mut_ptr ( ) , other. inner . as_mut_ptr ( ) ) . as_bool ( )
121
121
}
122
122
}
123
123
}
0 commit comments