Fix clippy in beta toolchain (#4299)
* clippy::lines_filter_map_ok * clippy::ineffective-open-options
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user