From 419e5b59b986479ab2384ba729bb2d5763732b46 Mon Sep 17 00:00:00 2001 From: numzero Date: Thu, 7 May 2026 22:03:32 +0300 Subject: [PATCH] add Debug --- src/ptr.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ptr.rs b/src/ptr.rs index fb47a2c..263b408 100644 --- a/src/ptr.rs +++ b/src/ptr.rs @@ -1,5 +1,6 @@ use std::{ any::Any, + fmt::Debug, marker::PhantomData, mem::ManuallyDrop, ops::{Deref, DerefMut}, @@ -32,6 +33,12 @@ impl DerefMut for OwnRef<'_, T> { } } +impl Debug for OwnRef<'_, T> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple("OwnRef").field(&&**self).finish() + } +} + impl OwnRef<'_, T> { pub unsafe fn new_unchecked(p: NonNull) -> Self { Self(Some(p), PhantomData)