diff --git a/crates/k8s-version/src/level/mod.rs b/crates/k8s-version/src/level/mod.rs index 9f65d2d71..d6d1c9096 100644 --- a/crates/k8s-version/src/level/mod.rs +++ b/crates/k8s-version/src/level/mod.rs @@ -47,22 +47,18 @@ pub enum Level { impl FromStr for Level { type Err = ParseLevelError; - // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below in this function. - // We can use expect here, because the correct match labels must be used. - // - // FIXME (@Techassi): This attribute can be used on individual unwrap and expect calls since - // Rust 1.91.0. We should move this attribute to not contaminate an unnecessarily large scope - // once we bump the toolchain to 1.91.0. - // See https://github.com/rust-lang/rust-clippy/pull/15445 - #[allow(clippy::unwrap_in_result)] fn from_str(input: &str) -> Result { let captures = LEVEL_REGEX.captures(input).context(InvalidFormatSnafu)?; + // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint here and below. + // We can use expect here, because the correct match labels must be used. + #[allow(clippy::unwrap_in_result)] let identifier = captures .name("identifier") .expect("internal error: check that the correct match label is specified") .as_str(); + #[allow(clippy::unwrap_in_result)] let version = captures .name("version") .expect("internal error: check that the correct match label is specified") diff --git a/crates/k8s-version/src/version/mod.rs b/crates/k8s-version/src/version/mod.rs index 04a59e179..ac4e92f96 100644 --- a/crates/k8s-version/src/version/mod.rs +++ b/crates/k8s-version/src/version/mod.rs @@ -53,17 +53,13 @@ pub struct Version { impl FromStr for Version { type Err = ParseVersionError; - // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below in this function. - // We can use expect here, because the correct match label must be used. - // - // FIXME (@Techassi): This attribute can be used on individual unwrap and expect calls since - // Rust 1.91.0. We should move this attribute to not contaminate an unnecessarily large scope - // once we bump the toolchain to 1.91.0. - // See https://github.com/rust-lang/rust-clippy/pull/15445 #[allow(clippy::unwrap_in_result)] fn from_str(input: &str) -> Result { let captures = VERSION_REGEX.captures(input).context(InvalidFormatSnafu)?; + // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below. + // We can use expect here, because the correct match label must be used. + #[allow(clippy::unwrap_in_result)] let major = captures .name("major") .expect("internal error: check that the correct match label is specified") diff --git a/crates/stackable-certs/src/ca/mod.rs b/crates/stackable-certs/src/ca/mod.rs index 97cda9a1c..90f8f700a 100644 --- a/crates/stackable-certs/src/ca/mod.rs +++ b/crates/stackable-certs/src/ca/mod.rs @@ -205,16 +205,6 @@ where /// validity, this function offers complete control over these parameters. /// If this level of control is not needed, use [`CertificateAuthority::new`] /// instead. - // - // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below in this function. - // We can use expect here, because the subject name is defined as a constant which must be able - // to be parsed. - // - // FIXME (@Techassi): This attribute can be used on individual unwrap and expect calls since - // Rust 1.91.0. We should move this attribute to not contaminate an unnecessarily large scope - // once we bump the toolchain to 1.91.0. - // See https://github.com/rust-lang/rust-clippy/pull/15445 - #[allow(clippy::unwrap_in_result)] #[instrument(name = "create_certificate_authority_with", skip(signing_key_pair))] pub fn new_with(signing_key_pair: S, serial_number: u64, validity: Duration) -> Result { let serial_number = SerialNumber::from(serial_number); @@ -223,6 +213,10 @@ where // We don't allow customization of the CA subject by callers. Every CA // created by us should contain the same subject consisting a common set // of distinguished names (DNs). + // SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below. + // We can use expect here, because the subject name is defined as a constant which must be + // able to be parsed. + #[allow(clippy::unwrap_in_result)] let subject = Name::from_str(SDP_ROOT_CA_SUBJECT) .expect("the constant SDP_ROOT_CA_SUBJECT must be a valid subject");