Refactor code based on clippy suggestions

This commit is contained in:
2022-08-25 17:45:16 -04:00
parent 9a9b5335f1
commit b97b2fe6d0
16 changed files with 145 additions and 204 deletions

View File

@@ -25,9 +25,11 @@ pub fn read_base64_lines(path: &str) -> Vec<Bytes> {
let br = BufReader::new(file);
br.lines()
.map(|line| {
BytesBase64::from_base64(&line.expect(&format!("Failed to read line in {}", path)))
.expect(&format!("Invalid base64 in {}", path))
.to_bytes()
BytesBase64::from_base64(
&line.unwrap_or_else(|_| panic!("Failed to read line in {}", path)),
)
.unwrap_or_else(|_| panic!("Invalid base64 in {}", path))
.to_bytes()
})
.collect()
}