From c8c039151963e29b92978444f2dc6590dd173ece Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 28 Nov 2014 15:41:16 +1300 Subject: Add some impls of Show (RefCell, Weak, some resolve types) --- src/liballoc/rc.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/liballoc') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 75d4342083b..436b134ad25 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -719,6 +719,17 @@ impl Clone for Weak { } } +#[experimental = "Show is experimental."] +impl fmt::Show for Weak { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if self.strong() == 0 { + write!(f, "NULL") + } else { + (*self._ptr).fmt(f) + } + } +} + #[doc(hidden)] trait RcBoxPtr { fn inner(&self) -> &RcBox; -- cgit 1.4.1-3-g733a5 From f0976e2cf3f6b0027f118b791e0888b29fbb41a7 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Thu, 1 Jan 2015 18:00:32 +1300 Subject: Reviewer change --- src/liballoc/rc.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 436b134ad25..bd250938836 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -722,11 +722,7 @@ impl Clone for Weak { #[experimental = "Show is experimental."] impl fmt::Show for Weak { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - if self.strong() == 0 { - write!(f, "NULL") - } else { - (*self._ptr).fmt(f) - } + write!(f, "(Weak)") } } -- cgit 1.4.1-3-g733a5