Skip to main content

validate_digest_flags

Function validate_digest_flags 

Source
pub fn validate_digest_flags(
    expect_digest: Option<&str>,
    no_verify_digest: bool,
) -> Result<(), Box<dyn Error>>
Expand description

Validate the (--expect-digest, --no-verify-digest) combination and fire the opt-out warning when applicable.

Rules:

  • One of the two must be supplied (no silent TOFU).
  • They cannot both be supplied — that’s an operator error.
  • On --no-verify-digest, the warning is printed.

Returns Ok(()) when the flags are coherent; otherwise an error message suitable for surfacing to the operator verbatim.