File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/cargo/sources/registry Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,9 @@ impl<'cfg> RegistryIndex<'cfg> {
379
379
pub fn hash ( & mut self , pkg : PackageId , load : & mut dyn RegistryData ) -> Poll < CargoResult < & str > > {
380
380
let req = OptVersionReq :: exact ( pkg. version ( ) ) ;
381
381
let summary = self . summaries ( & pkg. name ( ) , & req, load) ?;
382
- let summary = ready ! ( summary) . next ( ) ;
382
+ let summary = ready ! ( summary)
383
+ . filter ( |s| s. summary . version ( ) == pkg. version ( ) )
384
+ . next ( ) ;
383
385
Poll :: Ready ( Ok ( summary
384
386
. ok_or_else ( || internal ( format ! ( "no hash listed for {}" , pkg) ) ) ?
385
387
. summary
@@ -623,10 +625,10 @@ impl<'cfg> RegistryIndex<'cfg> {
623
625
load : & mut dyn RegistryData ,
624
626
) -> Poll < CargoResult < bool > > {
625
627
let req = OptVersionReq :: exact ( pkg. version ( ) ) ;
626
- let found = self
627
- . summaries ( & pkg . name ( ) , & req , load )
628
- . map_ok ( | mut p| p . any ( |summary| summary. yanked ) ) ;
629
- found
628
+ let found = ready ! ( self . summaries ( & pkg . name ( ) , & req , load ) ) ?
629
+ . filter ( |s| s . summary . version ( ) == pkg . version ( ) )
630
+ . any ( |summary| summary. yanked ) ;
631
+ Poll :: Ready ( Ok ( found) )
630
632
}
631
633
}
632
634
Original file line number Diff line number Diff line change @@ -694,6 +694,7 @@ impl<'cfg> RegistrySource<'cfg> {
694
694
. summaries ( & package. name ( ) , & req, & mut * self . ops ) ?
695
695
. expect ( "a downloaded dep now pending!?" )
696
696
. map ( |s| s. summary . clone ( ) )
697
+ . filter ( |s| s. version ( ) == package. version ( ) )
697
698
. next ( )
698
699
. expect ( "summary not found" ) ;
699
700
if let Some ( cksum) = summary_with_cksum. checksum ( ) {
You can’t perform that action at this time.
0 commit comments