Fix lints
This commit is contained in:
parent
a3f3b5e3ab
commit
7f16e697e6
1 changed files with 10 additions and 12 deletions
22
src/cache/fs.rs
vendored
22
src/cache/fs.rs
vendored
|
@ -91,20 +91,18 @@ pub(super) async fn read_file(
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let header = match Header::from_slice(&header_bytes) {
|
let header = if let Some(header) = Header::from_slice(&header_bytes) {
|
||||||
Some(header) => header,
|
header
|
||||||
None => {
|
} else {
|
||||||
warn!("Found file, but encrypted header was invalid. Assuming corrupted!");
|
warn!("Found file, but encrypted header was invalid. Assuming corrupted!");
|
||||||
return None;
|
return None;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let secret_stream = match SecretStream::init_pull(&header, key) {
|
let secret_stream = if let Ok(stream) = SecretStream::init_pull(&header, key) {
|
||||||
Ok(stream) => stream,
|
stream
|
||||||
Err(_) => {
|
} else {
|
||||||
warn!("Failed to init secret stream with key and header. Assuming corrupted!");
|
warn!("Failed to init secret stream with key and header. Assuming corrupted!");
|
||||||
return None;
|
return None;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Box::pin(EncryptedDiskReader::new(file, secret_stream))
|
Box::pin(EncryptedDiskReader::new(file, secret_stream))
|
||||||
|
|
Loading…
Reference in a new issue