@@ -408,7 +408,7 @@ impl<'cfg> RegistryIndex<'cfg> {
408408 /// the index file, aka [`IndexSummary`].
409409 pub fn hash ( & mut self , pkg : PackageId , load : & mut dyn RegistryData ) -> Poll < CargoResult < & str > > {
410410 let req = OptVersionReq :: exact ( pkg. version ( ) ) ;
411- let summary = self . summaries ( & pkg. name ( ) , & req, load) ?;
411+ let summary = self . summaries ( pkg. name ( ) , & req, load) ?;
412412 let summary = ready ! ( summary)
413413 . filter ( |s| s. package_id ( ) . version ( ) == pkg. version ( ) )
414414 . next ( ) ;
@@ -432,7 +432,7 @@ impl<'cfg> RegistryIndex<'cfg> {
432432 /// though since this method is called quite a lot on null builds in Cargo.
433433 fn summaries < ' a , ' b > (
434434 & ' a mut self ,
435- name : & str ,
435+ name : InternedString ,
436436 req : & ' b OptVersionReq ,
437437 load : & mut dyn RegistryData ,
438438 ) -> Poll < CargoResult < impl Iterator < Item = & ' a IndexSummary > + ' b > >
@@ -444,7 +444,6 @@ impl<'cfg> RegistryIndex<'cfg> {
444444 let source_id = self . source_id ;
445445
446446 // First up parse what summaries we have available.
447- let name = InternedString :: new ( name) ;
448447 let summaries = ready ! ( self . load_summaries( name, load) ?) ;
449448
450449 // Iterate over our summaries, extract all relevant ones which match our
@@ -539,7 +538,7 @@ impl<'cfg> RegistryIndex<'cfg> {
539538 /// This is primarily used by [`Source::query`](super::Source).
540539 pub fn query_inner (
541540 & mut self ,
542- name : & str ,
541+ name : InternedString ,
543542 req : & OptVersionReq ,
544543 load : & mut dyn RegistryData ,
545544 yanked_whitelist : & HashSet < PackageId > ,
@@ -572,7 +571,7 @@ impl<'cfg> RegistryIndex<'cfg> {
572571 /// The `online` controls whether Cargo can access the network when needed.
573572 fn query_inner_with_online (
574573 & mut self ,
575- name : & str ,
574+ name : InternedString ,
576575 req : & OptVersionReq ,
577576 load : & mut dyn RegistryData ,
578577 yanked_whitelist : & HashSet < PackageId > ,
@@ -604,7 +603,7 @@ impl<'cfg> RegistryIndex<'cfg> {
604603 . map ( |s| s. clone ( ) ) ;
605604
606605 // Handle `cargo update --precise` here.
607- let precise = source_id. precise_registry_version ( name) ;
606+ let precise = source_id. precise_registry_version ( name. as_str ( ) ) ;
608607 let summaries = summaries. filter ( |s| match & precise {
609608 Some ( ( current, requested) ) => {
610609 if req. matches ( current) {
@@ -647,7 +646,7 @@ impl<'cfg> RegistryIndex<'cfg> {
647646 load : & mut dyn RegistryData ,
648647 ) -> Poll < CargoResult < bool > > {
649648 let req = OptVersionReq :: exact ( pkg. version ( ) ) ;
650- let found = ready ! ( self . summaries( & pkg. name( ) , & req, load) ) ?
649+ let found = ready ! ( self . summaries( pkg. name( ) , & req, load) ) ?
651650 . filter ( |s| s. package_id ( ) . version ( ) == pkg. version ( ) )
652651 . any ( |summary| matches ! ( summary, IndexSummary :: Yanked ( _) ) ) ;
653652 Poll :: Ready ( Ok ( found) )
0 commit comments