fn validate_license(
    config: &mut gh_trs::config::types::Config,
    gh_token: impl AsRef<str>,
) -> Result<()> {
    match &config.license {
        Some(license) => {
            let spdx_id = validate_with_github_license_api(gh_token, license)?;
            validate_with_zenodo_license_api(&spdx_id)?;
            config.license = Some(spdx_id);
        },
        None => bail!("`license` is not specified. In Yevis, `license` must be a distributable license such as `CC0-1.0` or `MIT`"),
    };
    Ok(())
}
/// Validate the license of the metadata file.
/// Contact GitHub API and Zenodo API to confirm.
/// Change the license to `spdx_id`
/// e.g., `apache-2.0` -> `Apache-2.0`
Validate the license of the metadata file.
Contact GitHub API and Zenodo API to confirm.
Validate the license of the metadata file . Contact GitHub API and Zenodo API to confirm .
fn validate_license(
    config: &mut gh_trs::config::types::Config,
    gh_token: impl AsRef<str>,
) -> Result<()> {
    match &config.license {
        Some(license) => {
            let spdx_id = validate_with_github_license_api(gh_token, license)?;
            validate_with_zenodo_license_api(&spdx_id)?;
            config.license = Some(spdx_id);
        },
        None => bail!("`license` is not specified. In Yevis, `license` must be a distributable license such as `CC0-1.0` or `MIT`"),
    };
    Ok(())
}
fn validate_license ( config : & mut gh_trs :: config :: types :: Config , gh_token : impl AsRef < str > , ) -> Result < ( ) > { match & config . license { Some ( license ) => { let spdx_id = validate_with_github_license_api ( gh_token , license ) ? ; validate_with_zenodo_license_api ( & spdx_id ) ? ; config . license = Some ( spdx_id ) ; } , None => bail ! ( " " ) , } ; Ok ( ( ) ) }
Validate the license of the metadata file.
Validate the license of the metadata file .
config
&mut gh_trs::config::types::Config
gh_token
impl AsRef<str>
config
&mut gh_trs::config::types::Config
gh_token
impl AsRef<str>