diff options
Diffstat (limited to 'src/libstd/fmt/mod.rs')
| -rw-r--r-- | src/libstd/fmt/mod.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index c80177b4644..9f683e45678 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -493,11 +493,11 @@ use io; use iter; use iter::{Iterator, range}; use num::Signed; -use option::{Option,Some,None}; +use option::{Option, Some, None}; use owned::Box; use repr; -use result::{Ok, Err}; -use str::StrSlice; +use result::{Ok, Err, ResultUnwrap}; +use str::{StrSlice, StrAllocating, UTF16Item, ScalarValue, LoneSurrogate}; use str; use slice::{Vector, ImmutableVector}; use slice; @@ -1359,5 +1359,20 @@ impl Show for cmp::Ordering { } } +impl<T: Copy + Show> Show for Cell<T> { + fn fmt(&self, f: &mut Formatter) -> Result { + write!(f.buf, r"Cell \{ value: {} \}", self.get()) + } +} + +impl Show for UTF16Item { + fn fmt(&self, f: &mut Formatter) -> Result { + match *self { + ScalarValue(c) => write!(f.buf, "ScalarValue({})", c), + LoneSurrogate(u) => write!(f.buf, "LoneSurrogate({})", u), + } + } +} + // If you expected tests to be here, look instead at the run-pass/ifmt.rs test, // it's a lot easier than creating all of the rt::Piece structures here. |
