@@ -22,7 +22,7 @@ use std::fs::canonicalize;
2222use dunce:: canonicalize;
2323
2424use async_recursion:: async_recursion;
25- use futures:: future:: { self , join_all} ;
25+ use futures:: future:: join_all;
2626use futures:: TryFutureExt ;
2727use indexmap:: { IndexMap , IndexSet } ;
2828use semver:: Version ;
@@ -539,35 +539,36 @@ impl<'io, 'sess: 'io, 'ctx: 'sess> SessionIo<'sess, 'ctx> {
539539 // Initialize.
540540 self . sess . stats . num_database_init . increment ( ) ;
541541 // TODO MICHAERO: May need throttle
542- future:: lazy ( |_| {
543- stageln ! ( "Cloning" , "{} ({})" , name2, url2) ;
544- Ok ( ( ) )
545- } )
546- . and_then ( |_| git. clone ( ) . spawn_with ( |c| c. arg ( "init" ) . arg ( "--bare" ) ) )
547- . and_then ( |_| {
548- git. clone ( )
549- . spawn_with ( |c| c. arg ( "remote" ) . arg ( "add" ) . arg ( "origin" ) . arg ( url) )
550- } )
551- . and_then ( |_| git. clone ( ) . fetch ( "origin" ) )
552- . and_then ( |_| async {
553- if let Some ( reference) = fetch_ref {
554- git. clone ( ) . fetch_ref ( "origin" , reference) . await
555- } else {
556- Ok ( ( ) )
557- }
558- } )
559- . await
560- . map_err ( move |cause| {
561- if url3. contains ( "git@" ) {
562- warnln ! ( "Please ensure your public ssh key is added to the git server." ) ;
563- }
564- warnln ! ( "Please ensure the url is correct and you have access to the repository." ) ;
565- Error :: chain (
566- format ! ( "Failed to initialize git database in {:?}." , db_dir) ,
567- cause,
568- )
569- } )
570- . map ( move |_| git)
542+ stageln ! ( "Cloning" , "{} ({})" , name2, url2) ;
543+ git. clone ( )
544+ . spawn_with ( |c| c. arg ( "init" ) . arg ( "--bare" ) )
545+ . await ?;
546+ git. clone ( )
547+ . spawn_with ( |c| c. arg ( "remote" ) . arg ( "add" ) . arg ( "origin" ) . arg ( url) )
548+ . await ?;
549+ git. clone ( )
550+ . fetch ( "origin" )
551+ . and_then ( |_| async {
552+ if let Some ( reference) = fetch_ref {
553+ git. clone ( ) . fetch_ref ( "origin" , reference) . await
554+ } else {
555+ Ok ( ( ) )
556+ }
557+ } )
558+ . await
559+ . map_err ( move |cause| {
560+ if url3. contains ( "git@" ) {
561+ warnln ! ( "Please ensure your public ssh key is added to the git server." ) ;
562+ }
563+ warnln ! (
564+ "Please ensure the url is correct and you have access to the repository."
565+ ) ;
566+ Error :: chain (
567+ format ! ( "Failed to initialize git database in {:?}." , db_dir) ,
568+ cause,
569+ )
570+ } )
571+ . map ( move |_| git)
571572 } else {
572573 // Update if the manifest has been modified since the last fetch.
573574 let db_mtime = try_modification_time ( db_dir. join ( "FETCH_HEAD" ) ) ;
@@ -577,30 +578,30 @@ impl<'io, 'sess: 'io, 'ctx: 'sess> SessionIo<'sess, 'ctx> {
577578 }
578579 self . sess . stats . num_database_fetch . increment ( ) ;
579580 // TODO MICHAERO: May need throttle
580- future :: lazy ( |_| {
581- stageln ! ( "Fetching" , "{} ({})" , name2 , url2 ) ;
582- Ok ( ( ) )
583- } )
584- . and_then ( |_| git . clone ( ) . fetch ( "origin" ) )
585- . and_then ( |_| async {
586- if let Some ( reference ) = fetch_ref {
587- git . clone ( ) . fetch_ref ( "origin" , reference ) . await
588- } else {
589- Ok ( ( ) )
590- }
591- } )
592- . await
593- . map_err ( move |cause| {
594- if url3 . contains ( "git@" ) {
595- warnln ! ( "Please ensure your public ssh key is added to the git server." ) ;
596- }
597- warnln ! ( "Please ensure the url is correct and you have access to the repository." ) ;
598- Error :: chain (
599- format ! ( "Failed to update git database in {:?}." , db_dir) ,
600- cause,
601- )
602- } )
603- . map ( move |_| git)
581+ stageln ! ( "Fetching" , "{} ({})" , name2 , url2 ) ;
582+ git . clone ( )
583+ . fetch ( "origin" )
584+ . and_then ( |_| async {
585+ if let Some ( reference ) = fetch_ref {
586+ git . clone ( ) . fetch_ref ( "origin" , reference ) . await
587+ } else {
588+ Ok ( ( ) )
589+ }
590+ } )
591+ . await
592+ . map_err ( move |cause| {
593+ if url3 . contains ( "git@" ) {
594+ warnln ! ( "Please ensure your public ssh key is added to the git server." ) ;
595+ }
596+ warnln ! (
597+ "Please ensure the url is correct and you have access to the repository."
598+ ) ;
599+ Error :: chain (
600+ format ! ( "Failed to update git database in {:?}." , db_dir) ,
601+ cause,
602+ )
603+ } )
604+ . map ( move |_| git)
604605 }
605606 }
606607
@@ -1612,7 +1613,7 @@ pub struct DependencyEntry {
16121613
16131614impl DependencyEntry {
16141615 /// Obtain the dependency version for this entry.
1615- pub fn version ( & self ) -> DependencyVersion {
1616+ pub fn version ( & self ) -> DependencyVersion < ' _ > {
16161617 match self . source {
16171618 DependencySource :: Registry => unimplemented ! ( ) ,
16181619 DependencySource :: Path ( _) => DependencyVersion :: Path ,
0 commit comments