/// Download a blob from the repository and save it to the given
/// destination
/// `path`: Path on the server from which to download the package.
/// `repo`: A [Repository] instance.
/// `destination`: Local path to save the downloaded package.
Download a blob from the repository and save it to the given
destination
`path`: Path on the server from which to download the package.
`repo`: A [Repository] instance.
`destination`: Local path to save the downloaded package.
Download a blob from the repository and save it to the given destination ` path ` : Path on the server from which to download the package . ` repo ` : A [ Repository ] instance . ` destination ` : Local path to save the downloaded package .
async fn download_blob_to_destination(
    path: &str,
    repo: &Repository,
    destination: PathBuf,
) -> Result<()> {
    let res = repo.fetch_blob(path).await.map_err(|e| {
        ffx_error!("Cannot download file to {}. Error was {:#}", destination.display(), anyhow!(e))
    })?;
    copy(res.stream.into_async_read(), async_fs::File::create(destination).await?).await?;
    Ok(())
}
async fn download_blob_to_destination ( path : & str , repo : & Repository , destination : PathBuf , ) -> Result < ( ) > { let res = repo . fetch_blob ( path ) . await . map_err ( | e | { ffx_error ! ( " " destination display ( ) anyhow ( e ) ) } ) ? ; copy ( res . stream . into_async_read ( ) , async_fs :: File :: create ( destination ) . await ? ) . await ? ; Ok ( ( ) ) }
Download a blob from the repository and save it to the given
destination
`path`: Path on the server from which to download the package.
Download a blob from the repository and save it to the given destination ` path ` : Path on the server from which to download the package .
path
&str
repo
&Repository
destination
PathBuf