Review feedback: Use let ... map_err.

This commit is contained in:
Ximon Eighteen
2024-11-05 16:58:52 +01:00
parent f64050c32a
commit c2251dbca5
+1 -6
View File
@@ -194,12 +194,7 @@ impl SignZone {
}
let mut records = SortedRecords::new();
for entry in reader {
let Ok(entry) = entry else {
return Err(Error::from(format!(
"Invalid zone file: {}",
entry.unwrap_err()
)));
};
let entry = entry.map_err(|err| format!("Invalid zone file: {err}"))?;
match entry {
Entry::Record(record) => {
let record: StoredRecord = record.flatten_into();