@@ -107,6 +107,8 @@ impl RegistryCredentialConfig {
107
107
108
108
/// Returns the `Registry` and `Source` based on command-line and config settings.
109
109
///
110
+ /// * `source_ids`: The source IDs for the registry. It contains the original source ID and
111
+ /// the replacement source ID.
110
112
/// * `token_from_cmdline`: The token from the command-line. If not set, uses the token
111
113
/// from the config.
112
114
/// * `index`: The index URL from the command-line.
@@ -116,13 +118,12 @@ impl RegistryCredentialConfig {
116
118
/// * `token_required`: If `true`, the token will be set.
117
119
fn registry (
118
120
gctx : & GlobalContext ,
121
+ source_ids : & RegistrySourceIds ,
119
122
token_from_cmdline : Option < Secret < & str > > ,
120
123
reg_or_index : Option < & RegistryOrIndex > ,
121
124
force_update : bool ,
122
125
token_required : Option < Operation < ' _ > > ,
123
- ) -> CargoResult < ( Registry , RegistrySourceIds ) > {
124
- let source_ids = get_source_id ( gctx, reg_or_index) ?;
125
-
126
+ ) -> CargoResult < Registry > {
126
127
let is_index = reg_or_index. map ( |v| v. is_index ( ) ) . unwrap_or_default ( ) ;
127
128
if is_index && token_required. is_some ( ) && token_from_cmdline. is_none ( ) {
128
129
bail ! ( "command-line argument --index requires --token to be specified" ) ;
@@ -165,9 +166,11 @@ fn registry(
165
166
None
166
167
} ;
167
168
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 ,
171
174
) )
172
175
}
173
176
0 commit comments