diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-30 21:41:03 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-07 08:14:56 -0700 |
| commit | b024ba544c8cf831423cdd24d2dc516d66dc6269 (patch) | |
| tree | 8a2a05ed5213f327388e7cffd54f6f3bf657d64f /src/libstd/fmt | |
| parent | 06fcb6b1c81f1f5190d431c169cd0c725fecf18e (diff) | |
| download | rust-b024ba544c8cf831423cdd24d2dc516d66dc6269.tar.gz rust-b024ba544c8cf831423cdd24d2dc516d66dc6269.zip | |
core: Inherit the iter module
Diffstat (limited to 'src/libstd/fmt')
| -rw-r--r-- | src/libstd/fmt/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index a20f0392771..067ce608980 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -489,6 +489,7 @@ use char::Char; use container::Container; use io::MemWriter; use io; +use iter; use iter::{Iterator, range}; use num::Signed; use option::{Option,Some,None}; @@ -1301,5 +1302,18 @@ impl Show for TypeId { } } +impl<T: Show> Show for iter::MinMaxResult<T> { + fn fmt(&self, f: &mut Formatter) -> Result { + match *self { + iter::NoElements => + write!(f.buf, "NoElements"), + iter::OneElement(ref t) => + write!(f.buf, "OneElement({})", *t), + iter::MinMax(ref t1, ref t2) => + write!(f.buf, "MinMax({}, {})", *t1, *t2), + } + } +} + // 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. |
