@@ -107,6 +107,8 @@ impl RegistryCredentialConfig {
107107
108108/// Returns the `Registry` and `Source` based on command-line and config settings.
109109///
110+ /// * `source_ids`: The source IDs for the registry. It contains the original source ID and
111+ /// the replacement source ID.
110112/// * `token_from_cmdline`: The token from the command-line. If not set, uses the token
111113/// from the config.
112114/// * `index`: The index URL from the command-line.
@@ -116,13 +118,12 @@ impl RegistryCredentialConfig {
116118/// * `token_required`: If `true`, the token will be set.
117119fn registry (
118120 gctx : & GlobalContext ,
121+ source_ids : & RegistrySourceIds ,
119122 token_from_cmdline : Option < Secret < & str > > ,
120123 reg_or_index : Option < & RegistryOrIndex > ,
121124 force_update : bool ,
122125 token_required : Option < Operation < ' _ > > ,
123- ) -> CargoResult < ( Registry , RegistrySourceIds ) > {
124- let source_ids = get_source_id ( gctx, reg_or_index) ?;
125-
126+ ) -> CargoResult < Registry > {
126127 let is_index = reg_or_index. map ( |v| v. is_index ( ) ) . unwrap_or_default ( ) ;
127128 if is_index && token_required. is_some ( ) && token_from_cmdline. is_none ( ) {
128129 bail ! ( "command-line argument --index requires --token to be specified" ) ;
@@ -165,9 +166,11 @@ fn registry(
165166 None
166167 } ;
167168 let handle = http_handle ( gctx) ?;
168- Ok ( (
169- Registry :: new_handle ( api_host, token, handle, cfg. auth_required ) ,
170- source_ids,
169+ Ok ( Registry :: new_handle (
170+ api_host,
171+ token,
172+ handle,
173+ cfg. auth_required ,
171174 ) )
172175}
173176
0 commit comments