Skip to content

Commit 38e898b

Browse files
authored
Fix missing_debug_implementations for some crates (#1407)
1 parent 723a1a3 commit 38e898b

File tree

14 files changed

+51
-10
lines changed

14 files changed

+51
-10
lines changed

async-signature/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
)]
66
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
77
#![forbid(unsafe_code)]
8-
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
8+
#![warn(
9+
missing_docs,
10+
rust_2018_idioms,
11+
unused_qualifications,
12+
missing_debug_implementations
13+
)]
914

1015
pub use signature::{self, Error};
1116

cipher/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
1212
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
1313
)]
14-
#![warn(missing_docs, rust_2018_idioms, unused_lifetimes)]
14+
#![warn(
15+
missing_docs,
16+
rust_2018_idioms,
17+
unused_lifetimes,
18+
missing_debug_implementations
19+
)]
1520

1621
pub use crypto_common;
1722
pub use inout;

crypto-common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
88
)]
99
#![forbid(unsafe_code)]
10-
#![warn(missing_docs, rust_2018_idioms)]
10+
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]
1111

1212
#[cfg(feature = "std")]
1313
extern crate std;

crypto/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
77
)]
88
#![forbid(unsafe_code)]
9-
#![warn(rust_2018_idioms)]
9+
#![warn(rust_2018_idioms, missing_debug_implementations)]
1010

1111
pub use crypto_common as common;
1212

digest/src/core_api/ct_variable.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ where
162162
const OID: ObjectIdentifier = O::OID;
163163
}
164164

165+
impl<T, OutSize, O> fmt::Debug for CtVariableCoreWrapper<T, OutSize, O>
166+
where
167+
T: VariableOutputCore + AlgorithmName,
168+
OutSize: ArraySize + IsLessOrEqual<T::OutputSize>,
169+
LeEq<OutSize, T::OutputSize>: NonZero,
170+
{
171+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
172+
Self::write_alg_name(f)
173+
}
174+
}
175+
165176
/// Implement dummy type with hidden docs which is used to "carry" hasher
166177
/// OID for [`CtVariableCoreWrapper`].
167178
#[macro_export]

digest/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
3030
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
3131
)]
32-
#![warn(missing_docs, rust_2018_idioms)]
32+
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]
3333

3434
#[cfg(feature = "alloc")]
3535
#[macro_use]

digest/src/mac.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ impl<T: OutputSizeUser> PartialEq for CtOutput<T> {
241241

242242
impl<T: OutputSizeUser> Eq for CtOutput<T> {}
243243

244+
impl<T: OutputSizeUser> fmt::Debug for CtOutput<T> {
245+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
246+
f.write_str("CtOutput { ... }")
247+
}
248+
}
249+
244250
/// Error type for when the [`Output`] of a [`Mac`]
245251
/// is not equal to the expected value.
246252
#[derive(Default, Debug, Copy, Clone, Eq, PartialEq)]

kem/src/kem.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
33
use crate::errors::Error;
44

5-
use core::fmt::Debug;
5+
use core::fmt;
66

77
use generic_array::{ArrayLength, GenericArray};
88
use rand_core::{CryptoRng, RngCore};
99
use zeroize::{Zeroize, ZeroizeOnDrop};
1010

1111
/// Trait impl'd by concrete types that represent an encapsulated key. This is intended to be, in
1212
/// essence, a bag of bytes.
13-
pub trait EncappedKey: AsRef<[u8]> + Debug + Sized {
13+
pub trait EncappedKey: AsRef<[u8]> + fmt::Debug + Sized {
1414
/// The size, in bytes, of an encapsulated key.
1515
type EncappedKeySize: ArrayLength<u8>;
1616

@@ -38,6 +38,12 @@ pub trait EncappedKey: AsRef<[u8]> + Debug + Sized {
3838
/// The shared secret that results from key exchange.
3939
pub struct SharedSecret<EK: EncappedKey>(GenericArray<u8, EK::SharedSecretSize>);
4040

41+
impl<EK: EncappedKey> fmt::Debug for SharedSecret<EK> {
42+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
43+
f.write_str("SharedSecret { ... }")
44+
}
45+
}
46+
4147
// Zero the secret on drop
4248
impl<EK: EncappedKey> Drop for SharedSecret<EK> {
4349
fn drop(&mut self) {

kem/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
html_root_url = "https://docs.rs/kem"
88
)]
99
#![forbid(unsafe_code)]
10-
#![warn(missing_docs, unused_qualifications)]
10+
#![warn(missing_docs, unused_qualifications, missing_debug_implementations)]
1111

1212
#[cfg(feature = "std")]
1313
extern crate std;

password-hash/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
77
)]
88
#![forbid(unsafe_code)]
9-
#![warn(missing_docs, rust_2018_idioms, unused_lifetimes)]
9+
#![warn(
10+
missing_docs,
11+
rust_2018_idioms,
12+
unused_lifetimes,
13+
missing_debug_implementations
14+
)]
1015

1116
//!
1217
//! # Usage

0 commit comments

Comments
 (0)