false positive

feature/v32-tokens
Edward Shen 2021-04-22 13:40:19 -04:00
parent 7e4c54867e
commit 3c1388fced
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 3 additions and 0 deletions

3
src/cache/fs.rs vendored
View File

@ -51,6 +51,9 @@ pub async fn read_file(
ImageMetadata::deserialize(&mut de).ok()?
};
// False positive, `file` is used in both cases, which means that it's not
// possible to move this into a map_or_else without cloning `file`.
#[allow(clippy::option_if_let_else)]
let stream = if let Some(status) = WRITING_STATUS.read().await.get(path).map(Clone::clone) {
CacheStream::Concurrent(ConcurrentFsStream::from_file(
file,