diff --git a/explorer-api/src/geo_ip/location.rs b/explorer-api/src/geo_ip/location.rs index a507056828..59bbb33ad7 100644 --- a/explorer-api/src/geo_ip/location.rs +++ b/explorer-api/src/geo_ip/location.rs @@ -61,7 +61,7 @@ impl FailedIpAddresses { if Path::new(&file_path).exists() { if let Ok(file) = File::open(&file_path) { let lines = io::BufReader::new(file).lines(); - for ip in lines.flatten() { + for ip in lines.map_while(Result::ok) { failed_ips.insert(ip); } } diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs index 8840c78293..b3dc697464 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs @@ -96,11 +96,7 @@ impl HostsStore { /// Appends a line of `text` to the storefile at `path` pub(super) fn append(path: &Path, text: &str) { use std::io::Write; - let mut file = OpenOptions::new() - .write(true) - .append(true) - .open(path) - .unwrap(); + let mut file = OpenOptions::new().append(true).open(path).unwrap(); if let Err(e) = writeln!(file, "{text}") { log::error!("Couldn't write to file: {e}");