pub fn sync_crates(
    path: &Path,
    mirror: &ConfigMirror,
    crates: &ConfigCrates,
    user_agent: &HeaderValue,
) {
    eprintln!("{}", style("Syncing Crates repositories...").bold());

    if let Err(e) = crate::crates_index::sync_crates_repo(path, crates) {
        eprintln!("Downloading crates.io-index repository failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
        return;
    }

    if let Err(e) = crate::crates::sync_crates_files(path, mirror, crates, user_agent) {
        eprintln!("Downloading crates failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
        return;
    }

    if let Err(e) = crate::crates_index::update_crates_config(path, crates) {
        eprintln!("Updating crates.io-index config failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
    }

    eprintln!("{}", style("Syncing Crates repositories complete!").bold());
}
/// Synchronize and handle the crates.io-index repository.
Synchronize and handle the crates.io-index repository.
Synchronize and handle the crates . io - index repository .
pub fn sync_crates(
    path: &Path,
    mirror: &ConfigMirror,
    crates: &ConfigCrates,
    user_agent: &HeaderValue,
) {
    eprintln!("{}", style("Syncing Crates repositories...").bold());
    if let Err(e) = crate::crates_index::sync_crates_repo(path, crates) {
        eprintln!("Downloading crates.io-index repository failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
        return;
    }
    if let Err(e) = crate::crates::sync_crates_files(path, mirror, crates, user_agent) {
        eprintln!("Downloading crates failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
        return;
    }
    if let Err(e) = crate::crates_index::update_crates_config(path, crates) {
        eprintln!("Updating crates.io-index config failed: {:?}", e);
        eprintln!("You will need to sync again to finish this download.");
    }
    eprintln!("{}", style("Syncing Crates repositories complete!").bold());
}
pub fn sync_crates ( path : & Path , mirror : & ConfigMirror , crates : & ConfigCrates , user_agent : & HeaderValue , ) { eprintln ! ( " " style ( " " ) bold ( ) ) ; if let Err ( e ) = crate :: crates_index :: sync_crates_repo ( path , crates ) { eprintln ! ( " " e ) ; eprintln ! ( " " ) ; return ; } if let Err ( e ) = crate :: crates :: sync_crates_files ( path , mirror , crates , user_agent ) { eprintln ! ( " " e ) ; eprintln ! ( " " ) ; return ; } if let Err ( e ) = crate :: crates_index :: update_crates_config ( path , crates ) { eprintln ! ( " " e ) ; eprintln ! ( " " ) ; } eprintln ! ( " " style ( " " ) bold ( ) ) ; }
Synchronize and handle the crates.io-index repository.
Synchronize and handle the crates . io - index repository .
path
&Path
mirror
&ConfigMirror
crates
&ConfigCrates
user_agent
&HeaderValue
path
&Path
mirror
&ConfigMirror
crates
&ConfigCrates
user_agent
&HeaderValue