Preserve formatting options in Debug for NonNull/Unique
This commit is contained in:
parent
943a9e707c
commit
a1db237cd4
1 changed files with 2 additions and 2 deletions
|
|
@ -2346,7 +2346,7 @@ pub struct Unique<T: ?Sized> {
|
|||
#[unstable(feature = "ptr_internals", issue = "0")]
|
||||
impl<T: ?Sized> fmt::Debug for Unique<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:p}", self.as_ptr())
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2489,7 +2489,7 @@ pub struct NonNull<T: ?Sized> {
|
|||
#[stable(feature = "nonnull", since = "1.24.0")]
|
||||
impl<T: ?Sized> fmt::Debug for NonNull<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:p}", self.as_ptr())
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue