From 2631eaec4db3522e3749e59edd8f67709def38c6 Mon Sep 17 00:00:00 2001 From: Justin Kilpatrick Date: Thu, 14 Sep 2023 08:42:42 -0400 Subject: [PATCH] Fix clippy nit in exit test --- rita_client/src/exit_manager/exit_switcher.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rita_client/src/exit_manager/exit_switcher.rs b/rita_client/src/exit_manager/exit_switcher.rs index 163f1f87a..e2132e757 100644 --- a/rita_client/src/exit_manager/exit_switcher.rs +++ b/rita_client/src/exit_manager/exit_switcher.rs @@ -818,7 +818,8 @@ mod tests { // we use ipv6 addrs, but this should also work with ipv4 // Testing for initial error code, when we just start tracking. No current or tracking - let best_exit = Some(IpAddr::V4(Ipv4Addr::new(1, 12, 12, 12))); + let best_exit_unwrapped = IpAddr::V4(Ipv4Addr::new(1, 12, 12, 12)); + let best_exit = Some(best_exit_unwrapped); let mut tracking_exit: Option = None; let mut current_exit = None; @@ -831,7 +832,7 @@ mod tests { u16::MAX, tracking_exit, u16::MAX, - best_exit, + best_exit, 400 ), &mut vec, @@ -877,7 +878,7 @@ mod tests { current_exit = Some(IpAddr::V4(Ipv4Addr::new(1, 120, 120, 120))); tracking_exit = current_exit; - exit_map.insert(best_exit.unwrap(), ExitTracker::new(0, 91030, 1)); + exit_map.insert(best_exit_unwrapped, ExitTracker::new(0, 91030, 1)); assert_eq!( ExitSwitchingCode::ContinueCurrent, @@ -952,7 +953,7 @@ mod tests { append = vec![410, 410, 400, 400, 430, 430, 410, 410, 430, 400]; vec.append(&mut append); assert_eq!(vec.len(), 10); - exit_map.insert(best_exit.unwrap(), ExitTracker::new(0, 10, 1)); + exit_map.insert(best_exit_unwrapped, ExitTracker::new(0, 10, 1)); assert_eq!( ExitSwitchingCode::ResetTracking,