Change Debug implementation of BTree* as well

This commit is contained in:
Tobias Bucher 2015-02-11 00:14:48 +01:00
parent 408f7b5747
commit 870ad3bc75
2 changed files with 4 additions and 4 deletions

View File

@ -899,7 +899,7 @@ impl<K: Ord, V: Ord> Ord for BTreeMap<K, V> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Debug, V: Debug> Debug for BTreeMap<K, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "BTreeMap {{"));
try!(write!(f, "{{"));
for (i, (k, v)) in self.iter().enumerate() {
if i != 0 { try!(write!(f, ", ")); }

View File

@ -613,7 +613,7 @@ impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet<T>> for &'a BTreeSet<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Debug> Debug for BTreeSet<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "BTreeSet {{"));
try!(write!(f, "{{"));
for (i, x) in self.iter().enumerate() {
if i != 0 { try!(write!(f, ", ")); }
@ -911,7 +911,7 @@ mod test {
let set_str = format!("{:?}", set);
assert_eq!(set_str, "BTreeSet {1, 2}");
assert_eq!(format!("{:?}", empty), "BTreeSet {}");
assert_eq!(set_str, "{1, 2}");
assert_eq!(format!("{:?}", empty), "{}");
}
}