Skip to content

Commit 2cd3fc2

Browse files
authored
Implement Debug for all public items
1 parent 186f991 commit 2cd3fc2

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/buffer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ impl ToBuf for &[u8] {
148148
#[allow(clippy::len_without_is_empty)]
149149
pub struct TmpBuf<'a>(&'a mut [u8], usize);
150150

151+
impl core::fmt::Debug for TmpBuf<'_> {
152+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
153+
f.debug_struct("TmpBuf").field("data_len", &self.1).finish()
154+
}
155+
}
156+
151157
impl<'a> TmpBuf<'a> {
152158
/// Create a new temporary buffer from a mutable slice.
153159
pub fn new(buf: &'a mut [u8]) -> Self {

src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::crypto::rust_crypto;
1515
/// DTLS configuration shared by all connections.
1616
///
1717
/// Build with [`Config::builder()`] or use [`Config::default()`].
18-
#[derive(Clone)]
18+
#[derive(Clone, Debug)]
1919
pub struct Config {
2020
mtu: usize,
2121
max_queue_rx: usize,
@@ -201,6 +201,7 @@ impl Config {
201201
}
202202

203203
/// Builder for [`Config`]. See each setter for defaults.
204+
#[derive(Debug)]
204205
pub struct ConfigBuilder {
205206
mtu: usize,
206207
max_queue_rx: usize,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
#![warn(clippy::all)]
156156
#![allow(unknown_lints)]
157157
#![deny(missing_docs)]
158+
#![deny(missing_debug_implementations)]
158159

159160
#[macro_use]
160161
extern crate log;

0 commit comments

Comments
 (0)