Skip to content

Commit

Permalink
Remove superfluous unsafe {}
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Jan 30, 2024
1 parent 4fcc05c commit 5a08503
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions system-configuration/src/network_reachability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,11 @@ impl SCNetworkReachability {
run_loop: &CFRunLoop,
run_loop_mode: CFStringRef,
) -> Result<(), SchedulingError> {
if unsafe {
SCNetworkReachabilityScheduleWithRunLoop(
self.0,
run_loop.to_void() as *mut _,
run_loop_mode,
)
} == 0u8
if SCNetworkReachabilityScheduleWithRunLoop(
self.0,
run_loop.to_void() as *mut _,
run_loop_mode,
) == 0u8
{
Err(SchedulingError(()))
} else {
Expand All @@ -225,13 +223,11 @@ impl SCNetworkReachability {
run_loop: &CFRunLoop,
run_loop_mode: CFStringRef,
) -> Result<(), UnschedulingError> {
if unsafe {
SCNetworkReachabilityUnscheduleFromRunLoop(
self.0,
run_loop.to_void() as *mut _,
run_loop_mode,
)
} == 0u8
if SCNetworkReachabilityUnscheduleFromRunLoop(
self.0,
run_loop.to_void() as *mut _,
run_loop_mode,
) == 0u8
{
Err(UnschedulingError(()))
} else {
Expand Down

0 comments on commit 5a08503

Please sign in to comment.