@@ -218,15 +218,15 @@ impl SourceId {
218
218
/// Creates a SourceId from a remote registry URL when the registry name
219
219
/// cannot be determined, e.g. a user passes `--index` directly from CLI.
220
220
///
221
- /// Use [`SourceId::for_alt_registry `] if a name can provided, which
221
+ /// Use [`SourceId::for_named_registry `] if a name can provided, which
222
222
/// generates better messages for cargo.
223
223
pub fn for_registry ( url : & Url ) -> CargoResult < SourceId > {
224
224
let kind = Self :: remote_source_kind ( url) ;
225
225
SourceId :: new ( kind, url. to_owned ( ) , None )
226
226
}
227
227
228
228
/// Creates a `SourceId` from a remote registry URL with given name.
229
- pub fn for_alt_registry ( url : & Url , name : & str ) -> CargoResult < SourceId > {
229
+ pub fn for_named_registry ( url : & Url , name : & str ) -> CargoResult < SourceId > {
230
230
let kind = Self :: remote_source_kind ( url) ;
231
231
SourceId :: new ( kind, url. to_owned ( ) , Some ( name) )
232
232
}
@@ -288,7 +288,7 @@ impl SourceId {
288
288
return Self :: crates_io ( config) ;
289
289
}
290
290
let url = config. get_registry_index ( key) ?;
291
- Self :: for_alt_registry ( & url, key)
291
+ Self :: for_named_registry ( & url, key)
292
292
}
293
293
294
294
/// Gets this source URL.
@@ -926,7 +926,7 @@ mod tests {
926
926
assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "fb60813d6cb8df79" ) ;
927
927
928
928
let url = "https://your-crates.io" . into_url ( ) . unwrap ( ) ;
929
- let source_id = SourceId :: for_alt_registry ( & url, "alt" ) . unwrap ( ) ;
929
+ let source_id = SourceId :: for_named_registry ( & url, "alt" ) . unwrap ( ) ;
930
930
assert_eq ! ( gen_hash( source_id) , 12862859764592646184 ) ;
931
931
assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "09c10fd0cbd74bce" ) ;
932
932
@@ -936,7 +936,7 @@ mod tests {
936
936
assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "d1ea0d96f6f759b5" ) ;
937
937
938
938
let url = "sparse+https://your-crates.io" . into_url ( ) . unwrap ( ) ;
939
- let source_id = SourceId :: for_alt_registry ( & url, "alt" ) . unwrap ( ) ;
939
+ let source_id = SourceId :: for_named_registry ( & url, "alt" ) . unwrap ( ) ;
940
940
assert_eq ! ( gen_hash( source_id) , 5159702466575482972 ) ;
941
941
assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "135d23074253cb78" ) ;
942
942
0 commit comments