/// Determine the remote URL to download from, using the hooks if available
Determine the remote URL to download from, using the hooks if available
Determine the remote URL to download from using the hooks if available
fn determine_remote_url(version: &Version, hooks: Option<&ToolHooks<Yarn>>) -> Fallible<String> {
    let version_str = version.to_string();
    let distro_file_name = Yarn::archive_filename(&version_str);
    match hooks {
        Some(&ToolHooks {
            distro: Some(ref hook),
            ..
        }) => {
            debug!("Using yarn.distro hook to determine download URL");
            hook.resolve(&version, &distro_file_name)
        }
        _ => Ok(format!(
            "{}/v{}/{}",
            public_yarn_server_root(),
            version_str,
            distro_file_name
        )),
    }
}
fn determine_remote_url ( version : & Version , hooks : Option < & ToolHooks < Yarn > > ) -> Fallible < String > { let version_str = version . to_string ( ) ; let distro_file_name = Yarn :: archive_filename ( & version_str ) ; match hooks { Some ( & ToolHooks { distro : Some ( ref hook ) , .. } ) => { debug ! ( " " ) ; hook . resolve ( & version , & distro_file_name ) } _ => Ok ( format ! ( " " public_yarn_server_root ( ) version_str distro_file_name ) ) , } }
Determine the remote URL to download from, using the hooks if available
Determine the remote URL to download from using the hooks if available
version
&Version
hooks
Option<&ToolHooks<Yarn>>