diff options
| author | bors <bors@rust-lang.org> | 2015-01-07 05:31:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-07 05:31:23 +0000 |
| commit | 9e4e524e0eb17c8f463e731f23b544003e8709c6 (patch) | |
| tree | 916024d35e08f0826c20654f629ec596b5cb1f14 /src/libcollections/enum_set.rs | |
| parent | ea6f65c5f1a3f84e010d2cef02a0160804e9567a (diff) | |
| parent | a64000820f0fc32be4d7535a9a92418a434fa4ba (diff) | |
auto merge of #20677 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libcollections/enum_set.rs')
| -rw-r--r-- | src/libcollections/enum_set.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 4b94348e87a..1b852d0ba68 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -33,13 +33,13 @@ impl<E> Copy for EnumSet<E> {} impl<E:CLike+fmt::Show> fmt::Show for EnumSet<E> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - try!(write!(fmt, "{{")); + try!(write!(fmt, "EnumSet {{")); let mut first = true; for e in self.iter() { if !first { try!(write!(fmt, ", ")); } - try!(write!(fmt, "{}", e)); + try!(write!(fmt, "{:?}", e)); first = false; } write!(fmt, "}}") @@ -287,11 +287,11 @@ mod test { #[test] fn test_show() { let mut e = EnumSet::new(); - assert_eq!("{}", e.to_string()); + assert!(format!("{:?}", e) == "EnumSet {}"); e.insert(A); - assert_eq!("{A}", e.to_string()); + assert!(format!("{:?}", e) == "EnumSet {A}"); e.insert(C); - assert_eq!("{A, C}", e.to_string()); + assert!(format!("{:?}", e) == "EnumSet {A, C}"); } #[test] |
