@@ -408,7 +408,7 @@ impl<'cfg> RegistryIndex<'cfg> {
408
408
/// the index file, aka [`IndexSummary`].
409
409
pub fn hash ( & mut self , pkg : PackageId , load : & mut dyn RegistryData ) -> Poll < CargoResult < & str > > {
410
410
let req = OptVersionReq :: exact ( pkg. version ( ) ) ;
411
- let summary = self . summaries ( & pkg. name ( ) , & req, load) ?;
411
+ let summary = self . summaries ( pkg. name ( ) , & req, load) ?;
412
412
let summary = ready ! ( summary)
413
413
. filter ( |s| s. package_id ( ) . version ( ) == pkg. version ( ) )
414
414
. next ( ) ;
@@ -432,7 +432,7 @@ impl<'cfg> RegistryIndex<'cfg> {
432
432
/// though since this method is called quite a lot on null builds in Cargo.
433
433
fn summaries < ' a , ' b > (
434
434
& ' a mut self ,
435
- name : & str ,
435
+ name : InternedString ,
436
436
req : & ' b OptVersionReq ,
437
437
load : & mut dyn RegistryData ,
438
438
) -> Poll < CargoResult < impl Iterator < Item = & ' a IndexSummary > + ' b > >
@@ -444,7 +444,6 @@ impl<'cfg> RegistryIndex<'cfg> {
444
444
let source_id = self . source_id ;
445
445
446
446
// First up parse what summaries we have available.
447
- let name = InternedString :: new ( name) ;
448
447
let summaries = ready ! ( self . load_summaries( name, load) ?) ;
449
448
450
449
// Iterate over our summaries, extract all relevant ones which match our
@@ -539,7 +538,7 @@ impl<'cfg> RegistryIndex<'cfg> {
539
538
/// This is primarily used by [`Source::query`](super::Source).
540
539
pub fn query_inner (
541
540
& mut self ,
542
- name : & str ,
541
+ name : InternedString ,
543
542
req : & OptVersionReq ,
544
543
load : & mut dyn RegistryData ,
545
544
yanked_whitelist : & HashSet < PackageId > ,
@@ -572,7 +571,7 @@ impl<'cfg> RegistryIndex<'cfg> {
572
571
/// The `online` controls whether Cargo can access the network when needed.
573
572
fn query_inner_with_online (
574
573
& mut self ,
575
- name : & str ,
574
+ name : InternedString ,
576
575
req : & OptVersionReq ,
577
576
load : & mut dyn RegistryData ,
578
577
yanked_whitelist : & HashSet < PackageId > ,
@@ -604,7 +603,7 @@ impl<'cfg> RegistryIndex<'cfg> {
604
603
. map ( |s| s. clone ( ) ) ;
605
604
606
605
// 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 ( ) ) ;
608
607
let summaries = summaries. filter ( |s| match & precise {
609
608
Some ( ( current, requested) ) => {
610
609
if req. matches ( current) {
@@ -647,7 +646,7 @@ impl<'cfg> RegistryIndex<'cfg> {
647
646
load : & mut dyn RegistryData ,
648
647
) -> Poll < CargoResult < bool > > {
649
648
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) ) ?
651
650
. filter ( |s| s. package_id ( ) . version ( ) == pkg. version ( ) )
652
651
. any ( |summary| matches ! ( summary, IndexSummary :: Yanked ( _) ) ) ;
653
652
Poll :: Ready ( Ok ( found) )
0 commit comments