From 9387f5d455cc476c26e762abb5f9193e21f11680 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Tue, 25 Jun 2024 13:41:03 -0400 Subject: [PATCH] conf: tidy/tighten some dead_code allows --- rustls-libssl/src/conf.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/rustls-libssl/src/conf.rs b/rustls-libssl/src/conf.rs index 98bbf60..cac89c0 100644 --- a/rustls-libssl/src/conf.rs +++ b/rustls-libssl/src/conf.rs @@ -170,21 +170,17 @@ impl SslConfigCtx { #[derive(Debug, Copy, Clone, Eq, PartialEq)] #[repr(i32)] -#[allow(dead_code)] // TODO(XXX): Remove once other value types are used. pub(super) enum ValueType { /// The option is unrecognized. Unknown = 0x0, /// The option value is a string without any specific structure. String = 0x1, - /// The option value is a filename. - File = 0x2, - /// The option value is a directory name. - Dir = 0x3, - /// The option value is not used. - None = 0x4, - /// The option is an X509 store - // NOTE(XXX): This one is missing from the OpenSSL man pages. - Store = 0x5, + // The option value is a filename. + //File = 0x2, + // The option value is a directory name. + //Dir = 0x3, + // The option value is not used. + //None = 0x4, } impl From for c_int { @@ -259,12 +255,12 @@ type CommandAction = fn(&mut SslConfigCtx, value: Option<&str>) -> Result for c_int { #[derive(Default, Debug, Copy, Clone, Eq, PartialEq)] pub(super) struct Flags(c_uint); -#[allow(dead_code)] // TODO(XXX): Remove once all flags are used. impl Flags { const ANY: c_uint = 0x0; @@ -290,6 +285,7 @@ impl Flags { const SERVER: c_uint = 0x8; const SHOW_ERRORS: c_uint = 0x10; const CERTIFICATE: c_uint = 0x20; + #[allow(dead_code)] // TODO(XXX): Remove once REQUIRE_PRIVATE is used. const REQUIRE_PRIVATE: c_uint = 0x40; fn is_cmdline(&self) -> bool { @@ -312,6 +308,7 @@ impl Flags { self.0 & Self::CERTIFICATE == Self::CERTIFICATE } + #[allow(dead_code)] // TODO(XXX): Remove once REQUIRE_PRIVATE is used. fn is_require_private(&self) -> bool { self.0 & Self::REQUIRE_PRIVATE == Self::REQUIRE_PRIVATE }