@@ -6,8 +6,7 @@ use std::sync::Arc;
66use docs_rs:: db:: { self , add_path_into_database, Pool , PoolClient } ;
77use docs_rs:: utils:: { remove_crate_priority, set_crate_priority} ;
88use docs_rs:: {
9- BuildQueue , Config , Context , DocBuilder , Index , Metrics , PackageKind , RustwideBuilder , Server ,
10- Storage ,
9+ BuildQueue , Config , Context , DocBuilder , Index , Metrics , RustwideBuilder , Server , Storage ,
1110} ;
1211use failure:: { err_msg, Error , ResultExt } ;
1312use once_cell:: sync:: OnceCell ;
@@ -258,16 +257,8 @@ enum BuildSubcommand {
258257 #[ structopt( name = "CRATE_VERSION" ) ]
259258 crate_version : Option < String > ,
260259
261- /// Url for registry different from cratesio
262- #[ structopt( name = "CRATE_REGISTRY" ) ]
263- crate_registry : Option < String > ,
264-
265260 /// Build a crate at a specific path
266- #[ structopt(
267- short = "l" ,
268- long = "local" ,
269- conflicts_with_all( & [ "CRATE_NAME" , "CRATE_VERSION" , "CRATE_REGISTRY" ] )
270- ) ]
261+ #[ structopt( short = "l" , long = "local" , conflicts_with_all( & [ "CRATE_NAME" , "CRATE_VERSION" ] ) ) ]
271262 local : Option < PathBuf > ,
272263 } ,
273264
@@ -308,7 +299,6 @@ impl BuildSubcommand {
308299 Self :: Crate {
309300 crate_name,
310301 crate_version,
311- crate_registry,
312302 local,
313303 } => {
314304 let mut builder = rustwide_builder ( ) ?;
@@ -323,10 +313,7 @@ impl BuildSubcommand {
323313 & crate_name. ok_or_else ( || err_msg ( "must specify name if not local" ) ) ?,
324314 & crate_version
325315 . ok_or_else ( || err_msg ( "must specify version if not local" ) ) ?,
326- crate_registry
327- . as_ref ( )
328- . map ( |s| PackageKind :: Registry ( s. as_str ( ) ) )
329- . unwrap_or ( PackageKind :: CratesIo ) ,
316+ None ,
330317 )
331318 . context ( "Building documentation failed" ) ?;
332319 }
@@ -606,16 +593,7 @@ impl Context for BinContext {
606593 fn index ( & self ) -> Result < Arc < Index > , Error > {
607594 Ok ( self
608595 . index
609- . get_or_try_init :: < _ , Error > ( || {
610- let config = self . config ( ) ?;
611- Ok ( Arc :: new (
612- if let Some ( registry_url) = config. registry_url . clone ( ) {
613- Index :: from_url ( config. registry_index_path . clone ( ) , registry_url)
614- } else {
615- Index :: new ( config. registry_index_path . clone ( ) )
616- } ?,
617- ) )
618- } ) ?
596+ . get_or_try_init :: < _ , Error > ( || Ok ( Arc :: new ( Index :: new ( & * self . config ( ) ?) ?) ) ) ?
619597 . clone ( ) )
620598 }
621599}
0 commit comments