Skip to content

Commit

Permalink
Preserve formatting options in Debug for NonNull/Unique
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 20, 2018
1 parent 943a9e7 commit a1db237
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/ptr.rs
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit a1db237

Please sign in to comment.