diff --git a/src/config.rs b/src/config.rs index adc7d31..6dcc08f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -489,7 +489,7 @@ mod test { .await; } - for _i in 0..10 { + for _ in 0..10 { ctx.update_blocklist(&mut IpData { ip: "1.1.1.2".to_string(), hostname: "test2".to_string(), @@ -541,7 +541,8 @@ mod test { let pending = ctx.get_blocklist_pending().await; assert_eq!(pending.len(), 4); - for i in ["1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4"] { + let ips = ["1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4"]; + for i in ips { let ip = ctx .blocklist .get(&i.to_string()) @@ -565,11 +566,10 @@ mod test { let mut ctx = prepare_test_data().await; let after_gc = ctx.gc_blocklist().await; assert_eq!(after_gc.len(), 2); - for i in &["1.1.1.3", "1.1.1.4"] { - assert_eq!( - ctx.blocklist.get(&i.to_string()).unwrap().ipdata.ip, - i.to_string() - ); + let ips = &["1.1.1.3", "1.1.1.4"]; + for ip in ips { + let ipstring = ip.to_string(); + assert_eq!(ctx.blocklist.get(&ipstring).unwrap().ipdata.ip, ipstring); } } } diff --git a/src/utils.rs b/src/utils.rs index a27c9cd..d16b248 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -33,7 +33,7 @@ pub fn _dedup(list: &mut Vec) -> usize { list.len() } -pub fn sleep_ms(ms: u64) { +pub fn _sleep_ms(ms: u64) { std::thread::sleep(Duration::from_millis(ms)); }