pub fn resolve_workspace_config(workspace_root: &Path) -> Result<Config, FatalError> {
    let mut config = Config::default();

    // User-local configuration from home directory.
    let home_dir = dirs_next::home_dir();
    if let Some(mut home) = home_dir {
        home.push(".release.toml");
        if let Some(cfg) = get_config_from_file(&home)? {
            config.update(&cfg);
        }
    };

    let config_dir = dirs_next::config_dir();
    if let Some(mut config_path) = config_dir {
        config_path.push("cargo-release/release.toml");
        if let Some(cfg) = get_config_from_file(&config_path)? {
            config.update(&cfg);
        }
    };

    // Workspace config
    let default_config = workspace_root.join("release.toml");
    let current_dir_config = get_config_from_file(&default_config)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };

    let manifest_path = workspace_root.join("Cargo.toml");
    let current_dir_config = get_ws_config_from_manifest(&manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };

    Ok(config)
}
/// Try to resolve workspace configuration source.
///
/// This tries the following sources in order, merging the results:
/// 1. $HOME/.release.toml
/// 2. $HOME/.config/cargo-release/release.toml
/// 3. $(workspace)/release.toml
/// 3. $(workspace)/Cargo.toml
Try to resolve workspace configuration source.
This tries the following sources in order, merging the results:
1.
Try to resolve workspace configuration source . This tries the following sources in order merging the results : 1 .
pub fn resolve_workspace_config(workspace_root: &Path) -> Result<Config, FatalError> {
    let mut config = Config::default();
    // User-local configuration from home directory.
    let home_dir = dirs_next::home_dir();
    if let Some(mut home) = home_dir {
        home.push(".release.toml");
        if let Some(cfg) = get_config_from_file(&home)? {
            config.update(&cfg);
        }
    };
    let config_dir = dirs_next::config_dir();
    if let Some(mut config_path) = config_dir {
        config_path.push("cargo-release/release.toml");
        if let Some(cfg) = get_config_from_file(&config_path)? {
            config.update(&cfg);
        }
    };
    // Workspace config
    let default_config = workspace_root.join("release.toml");
    let current_dir_config = get_config_from_file(&default_config)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };
    let manifest_path = workspace_root.join("Cargo.toml");
    let current_dir_config = get_ws_config_from_manifest(&manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };
    Ok(config)
}
pub fn resolve_workspace_config ( workspace_root : & Path ) -> Result < Config , FatalError > { let mut config = Config :: default ( ) ; // User-local configuration from home directory. let home_dir = dirs_next :: home_dir ( ) ; if let Some ( mut home ) = home_dir { home . push ( " " ) ; if let Some ( cfg ) = get_config_from_file ( & home ) ? { config . update ( & cfg ) ; } } ; let config_dir = dirs_next :: config_dir ( ) ; if let Some ( mut config_path ) = config_dir { config_path . push ( " " ) ; if let Some ( cfg ) = get_config_from_file ( & config_path ) ? { config . update ( & cfg ) ; } } ; // Workspace config let default_config = workspace_root . join ( " " ) ; let current_dir_config = get_config_from_file ( & default_config ) ? ; if let Some ( cfg ) = current_dir_config { config . update ( & cfg ) ; } ; let manifest_path = workspace_root . join ( " " ) ; let current_dir_config = get_ws_config_from_manifest ( & manifest_path ) ? ; if let Some ( cfg ) = current_dir_config { config . update ( & cfg ) ; } ; Ok ( config ) }
Try to resolve workspace configuration source.
Try to resolve workspace configuration source .
workspace_root
&Path
workspace_root
&Path