Skip to content

Commit

Permalink
Change Debug implementation of BTree* as well
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Feb 24, 2015
1 parent 408f7b5 commit 870ad3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libcollections/btree/map.rs
Expand Up @@ -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, ", ")); }
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/btree/set.rs
Expand Up @@ -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, ", ")); }
Expand Down Expand Up @@ -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), "{}");
}
}

0 comments on commit 870ad3b

Please sign in to comment.