From 421594afd4dd609061a2572df0a22e22e2d6d007 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 10 Nov 2023 11:47:29 -0500 Subject: [PATCH] validation/extension: remove more dead_code attrs Signed-off-by: William Woodruff --- .../cryptography-x509-validation/src/policy/extension.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/rust/cryptography-x509-validation/src/policy/extension.rs b/src/rust/cryptography-x509-validation/src/policy/extension.rs index a4396203a693..482fd73dde07 100644 --- a/src/rust/cryptography-x509-validation/src/policy/extension.rs +++ b/src/rust/cryptography-x509-validation/src/policy/extension.rs @@ -12,10 +12,7 @@ use crate::ops::CryptoOps; use super::{Policy, PolicyError}; -// TODO: Remove `dead_code` attributes once we start using these helpers. - /// Represents different criticality states for an extension. -#[allow(dead_code)] pub(crate) enum Criticality { /// The extension MUST be marked as critical. Critical, @@ -25,7 +22,6 @@ pub(crate) enum Criticality { NonCritical, } -#[allow(dead_code)] impl Criticality { pub(crate) fn permits(&self, critical: bool) -> bool { match (self, critical) { @@ -38,16 +34,13 @@ impl Criticality { } } -#[allow(dead_code)] type PresentExtensionValidatorCallback = fn(&Policy<'_, B>, &Certificate<'_>, &Extension<'_>) -> Result<(), PolicyError>; -#[allow(dead_code)] type MaybeExtensionValidatorCallback = fn(&Policy<'_, B>, &Certificate<'_>, Option<&Extension<'_>>) -> Result<(), PolicyError>; /// Represents different validation states for an extension. -#[allow(dead_code)] pub(crate) enum ExtensionValidator { /// The extension MUST NOT be present. NotPresent, @@ -69,13 +62,11 @@ pub(crate) enum ExtensionValidator { /// A "policy" for validating a specific X.509v3 extension, identified by /// its OID. -#[allow(dead_code)] pub(crate) struct ExtensionPolicy { pub(crate) oid: asn1::ObjectIdentifier, pub(crate) validator: ExtensionValidator, } -#[allow(dead_code)] impl ExtensionPolicy { pub(crate) fn not_present(oid: ObjectIdentifier) -> Self { Self {