Fix fmt and clippy on Rust 1.95

The rebase onto upstream main bumped rust-toolchain to 1.95, which
flagged two things the 1.94 compiler didn't catch:

- rustfmt collapses build_redirect_uri's signature onto one line
- clippy's collapsible_if catches the nested if in validate_config

Style only, no behavior change.
This commit is contained in:
nathanmoreton 2026-05-01 14:36:13 -05:00
parent 1fce93bb68
commit a2d60c352b
2 changed files with 6 additions and 10 deletions

View file

@ -69,10 +69,7 @@ fn sso_cookie_vendor(cookies: &CookieJar<'_>) -> Result<Redirect, (Status, Html<
///
/// Checks for a single (non-sharded) cookie first. If found, it takes precedence.
/// Otherwise, checks for sharded cookies ({name}-0 through {name}-19).
fn build_redirect_uri(
cookie_name: &str,
cookies: &HashMap<String, String>,
) -> Result<String, (Status, Html<String>)> {
fn build_redirect_uri(cookie_name: &str, cookies: &HashMap<String, String>) -> Result<String, (Status, Html<String>)> {
// Check for the single (non-sharded) cookie — takes precedence over shards
if let Some(value) = cookies.get(cookie_name) {
let encoded_value = url_encode(value);

View file

@ -1091,13 +1091,12 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> {
validate_sso_master_password_policy(cfg.sso_master_password_policy.as_ref())?;
}
if cfg.sso_cookie_vendor_enabled {
if cfg.sso_cookie_vendor_idp_login_url.is_empty()
if cfg.sso_cookie_vendor_enabled
&& (cfg.sso_cookie_vendor_idp_login_url.is_empty()
|| cfg.sso_cookie_vendor_cookie_name.is_empty()
|| cfg.sso_cookie_vendor_cookie_domain.is_empty()
{
err!("`SSO_COOKIE_VENDOR_IDP_LOGIN_URL`, `SSO_COOKIE_VENDOR_COOKIE_NAME` and `SSO_COOKIE_VENDOR_COOKIE_DOMAIN` must be set when SSO cookie vendor is enabled")
}
|| cfg.sso_cookie_vendor_cookie_domain.is_empty())
{
err!("`SSO_COOKIE_VENDOR_IDP_LOGIN_URL`, `SSO_COOKIE_VENDOR_COOKIE_NAME` and `SSO_COOKIE_VENDOR_COOKIE_DOMAIN` must be set when SSO cookie vendor is enabled")
}
if cfg._enable_yubico {