diff --git a/src/main.rs b/src/main.rs index 3efd4881..eed8b0a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -648,10 +648,10 @@ fn system_resolv_conf() -> anyhow::Result<(ResolverConfig, ResolverOpts)> { #[cfg(unix)] if env::var("TERMUX_VERSION").is_ok() { let prefix = env::var("PREFIX")?; - let path = format!("{}/etc/resolv.conf", prefix); - let conf_data = std::fs::read(&path).context(format!("DNS: failed to load {}", path))?; + let path = format!("{prefix}/etc/resolv.conf"); + let conf_data = std::fs::read(&path).context(format!("DNS: failed to load {path}"))?; return hickory_resolver::system_conf::parse_resolv_conf(conf_data) - .context(format!("DNS: failed to parse {}", path)); + .context(format!("DNS: failed to parse {path}")); } hickory_resolver::system_conf::read_system_conf() diff --git a/src/printer.rs b/src/printer.rs index 7500bf33..7a9b9a2b 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -371,7 +371,7 @@ fn print_summary( w, "{}", style.success_rate( - &format!(" Success rate:\t{:.2}%", success_rate), + &format!(" Success rate:\t{success_rate:.2}%"), success_rate ) )?; @@ -597,7 +597,7 @@ fn print_distribution( writeln!( w, "{}", - style.latency_distribution(&format!(" {:.2}% in {:.4} secs", p, v), *v) + style.latency_distribution(&format!(" {p:.2}% in {v:.4} secs"), *v) )?; } diff --git a/src/url_generator.rs b/src/url_generator.rs index a780d1f0..1b4b613a 100644 --- a/src/url_generator.rs +++ b/src/url_generator.rs @@ -61,7 +61,7 @@ mod tests { fn test_url_generator_dynamic() { let path_regex = "/[a-z][a-z][0-9]"; let url_generator = UrlGenerator::new_dynamic( - RandRegex::compile(&format!(r"http://127\.0\.0\.1{}", path_regex), 4).unwrap(), + RandRegex::compile(&format!(r"http://127\.0\.0\.1{path_regex}"), 4).unwrap(), ); let url = url_generator.generate(&mut thread_rng()).unwrap(); assert_eq!(url.host(), Some(Host::Ipv4(Ipv4Addr::new(127, 0, 0, 1)))); diff --git a/tests/tests.rs b/tests/tests.rs index 757ae00b..86d82f1f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -763,14 +763,14 @@ async fn test_json_schema() { if let Err(errors) = schema.validate(&value) { for error in errors { - eprintln!("{}", error); + eprintln!("{error}"); } panic!("JSON schema validation failed\n{output_json}"); } if let Err(errors) = schema.validate(&value_stats_success_breakdown) { for error in errors { - eprintln!("{}", error); + eprintln!("{error}"); } panic!("JSON schema validation failed\n{output_json_stats_success_breakdown}"); }/* ?? */;