@@ -218,15 +218,15 @@ impl SourceId {
218218 /// Creates a SourceId from a remote registry URL when the registry name
219219 /// cannot be determined, e.g. a user passes `--index` directly from CLI.
220220 ///
221- /// Use [`SourceId::for_alt_registry `] if a name can provided, which
221+ /// Use [`SourceId::for_named_registry `] if a name can provided, which
222222 /// generates better messages for cargo.
223223 pub fn for_registry ( url : & Url ) -> CargoResult < SourceId > {
224224 let kind = Self :: remote_source_kind ( url) ;
225225 SourceId :: new ( kind, url. to_owned ( ) , None )
226226 }
227227
228228 /// 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 > {
230230 let kind = Self :: remote_source_kind ( url) ;
231231 SourceId :: new ( kind, url. to_owned ( ) , Some ( name) )
232232 }
@@ -288,7 +288,7 @@ impl SourceId {
288288 return Self :: crates_io ( config) ;
289289 }
290290 let url = config. get_registry_index ( key) ?;
291- Self :: for_alt_registry ( & url, key)
291+ Self :: for_named_registry ( & url, key)
292292 }
293293
294294 /// Gets this source URL.
@@ -926,7 +926,7 @@ mod tests {
926926 assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "fb60813d6cb8df79" ) ;
927927
928928 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 ( ) ;
930930 assert_eq ! ( gen_hash( source_id) , 12862859764592646184 ) ;
931931 assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "09c10fd0cbd74bce" ) ;
932932
@@ -936,7 +936,7 @@ mod tests {
936936 assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "d1ea0d96f6f759b5" ) ;
937937
938938 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 ( ) ;
940940 assert_eq ! ( gen_hash( source_id) , 5159702466575482972 ) ;
941941 assert_eq ! ( crate :: util:: hex:: short_hash( & source_id) , "135d23074253cb78" ) ;
942942
0 commit comments