diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index c4c40a01a9fb..0a9c78d56fef 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -1806,8 +1806,7 @@ pub fn prune(cache: &Cache) -> Result { // directories. let revision = entry.path().join("revision.http"); if revision.is_file() { - let pointer = HttpRevisionPointer::read_from(revision)?; - if let Some(pointer) = pointer { + if let Ok(Some(pointer)) = HttpRevisionPointer::read_from(revision) { // Remove all sibling directories that are not referenced by the pointer. for sibling in entry.path().read_dir().map_err(Error::CacheRead)? { let sibling = sibling.map_err(Error::CacheRead)?; @@ -1832,8 +1831,7 @@ pub fn prune(cache: &Cache) -> Result { // directories. let revision = entry.path().join("revision.rev"); if revision.is_file() { - let pointer = LocalRevisionPointer::read_from(revision)?; - if let Some(pointer) = pointer { + if let Ok(Some(pointer)) = LocalRevisionPointer::read_from(revision) { // Remove all sibling directories that are not referenced by the pointer. for sibling in entry.path().read_dir().map_err(Error::CacheRead)? { let sibling = sibling.map_err(Error::CacheRead)?;