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