Skip to content

Commit f258569

Browse files
committed
Fix index_v version check.
The whole point is that when loading a cache from an earlier version, that cache may be missing new entries. So don't load older caches.
1 parent 0d4137f commit f258569

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cargo/sources/registry/index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,9 @@ impl<'a> SummariesCache<'a> {
708708
.get(..4)
709709
.ok_or_else(|| anyhow::anyhow!("cache expected 4 bytes for index version"))?;
710710
let index_v = u32::from_le_bytes(index_v_bytes.try_into().unwrap());
711-
if index_v > INDEX_V_MAX {
711+
if index_v != INDEX_V_MAX {
712712
bail!(
713-
"index format version {} is greater than the newest version I know ({})",
713+
"index format version {} doesn't match the version I know ({})",
714714
index_v,
715715
INDEX_V_MAX
716716
);

0 commit comments

Comments
 (0)