pub fn resolve_config(workspace_root: &Path, manifest_path: &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);
        }
    };

    let crate_root = manifest_path.parent().unwrap_or_else(|| Path::new("."));

    // Workspace config
    if crate_root != workspace_root {
        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 current_dir_config = get_ws_config_from_manifest(manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };

    // Crate config
    let default_config = crate_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 current_dir_config = get_pkg_config_from_manifest(manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };

    Ok(config)
}
/// Try to resolve configuration source.
///
/// This tries the following sources in order, merging the results:
/// 1. $HOME/.release.toml
/// 2. $HOME/.config/release.toml
/// 3. $(workspace)/release.toml
/// 3. $(workspace)/Cargo.toml `workspace.metadata.release`
/// 4. $(crate)/release.toml
/// 5. $(crate)/Cargo.toml `package.metadata.release`
///
/// `$(crate)/Cargo.toml` is a way to differentiate configuration for the root crate and the
/// workspace.
Try to resolve configuration source.
This tries the following sources in order, merging the results:
1.

`$(crate)/Cargo.toml` is a way to differentiate configuration for the root crate and the
workspace.
Try to resolve configuration source . This tries the following sources in order merging the results : 1 . ` $ ( crate ) / Cargo . toml ` is a way to differentiate configuration for the root crate and the workspace .
pub fn resolve_config(workspace_root: &Path, manifest_path: &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);
        }
    };
    let crate_root = manifest_path.parent().unwrap_or_else(|| Path::new("."));
    // Workspace config
    if crate_root != workspace_root {
        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 current_dir_config = get_ws_config_from_manifest(manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };
    // Crate config
    let default_config = crate_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 current_dir_config = get_pkg_config_from_manifest(manifest_path)?;
    if let Some(cfg) = current_dir_config {
        config.update(&cfg);
    };
    Ok(config)
}
pub fn resolve_config ( workspace_root : & Path , manifest_path : & 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 ) ; } } ; let crate_root = manifest_path . parent ( ) . unwrap_or_else ( | | Path :: new ( " " ) ) ; // Workspace config if crate_root != workspace_root { 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 current_dir_config = get_ws_config_from_manifest ( manifest_path ) ? ; if let Some ( cfg ) = current_dir_config { config . update ( & cfg ) ; } ; // Crate config let default_config = crate_root . join ( " " ) ; let current_dir_config = get_config_from_file ( & default_config ) ? ; if let Some ( cfg ) = current_dir_config { config . update ( & cfg ) ; } ; let current_dir_config = get_pkg_config_from_manifest ( manifest_path ) ? ; if let Some ( cfg ) = current_dir_config { config . update ( & cfg ) ; } ; Ok ( config ) }
Try to resolve configuration source.
Try to resolve configuration source .
workspace_root
&Path
manifest_path
&Path
workspace_root
&Path
manifest_path
&Path