diff --git a/src/cargo/sources/registry/index.rs b/src/cargo/sources/registry/index.rs index 4cacc1f68c6c..1d45de8a278f 100644 --- a/src/cargo/sources/registry/index.rs +++ b/src/cargo/sources/registry/index.rs @@ -858,7 +858,9 @@ impl IndexSummary { } } let mut summary = Summary::new(config, pkgid, deps, &features, links)?; - cksum.map(|cksum| summary.set_checksum(cksum)); + if let Some(cksum) = cksum { + summary.set_checksum(cksum); + } Ok(IndexSummary { summary, yanked: yanked.unwrap_or(false),