diff options
| author | Botahamec <botahamec@outlook.com> | 2022-10-26 22:40:58 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2022-10-26 22:40:58 -0400 |
| commit | 3bae2353944d5b3686ee7b3d4a5527fb37d5565f (patch) | |
| tree | f712e46e6866416e3034f12900458083889c31e8 /src/lib.rs | |
| parent | 083eb5c3161f10192638abd0b29a687e4a285a60 (diff) | |
Manually implement Debug
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,5 @@ +use std::fmt::{self, Debug}; + use parking_lot::Mutex; thread_local! { @@ -5,11 +7,16 @@ thread_local! { pub static KEY: Mutex<Option<ThreadKey>> = Mutex::new(Some(unsafe { ThreadKey::new() })); } -#[derive(Debug)] pub struct ThreadKey { _priv: *const (), // this isn't Send or Sync } +impl Debug for ThreadKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + "ThreadKey".fmt(f) + } +} + impl ThreadKey { unsafe fn new() -> Self { Self { |
