false positive

This commit is contained in:
Edward Shen 2021-04-22 13:40:19 -04:00
parent 7e4c54867e
commit 3c1388fced
Signed by: edward
GPG key ID: 19182661E818369F

3
src/cache/fs.rs vendored
View file

@ -51,6 +51,9 @@ pub async fn read_file(
ImageMetadata::deserialize(&mut de).ok()? 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) { let stream = if let Some(status) = WRITING_STATUS.read().await.get(path).map(Clone::clone) {
CacheStream::Concurrent(ConcurrentFsStream::from_file( CacheStream::Concurrent(ConcurrentFsStream::from_file(
file, file,