提交 870ad3bc 编写于 作者: T Tobias Bucher

Change `Debug` implementation of `BTree*` as well

上级 408f7b57
......@@ -899,7 +899,7 @@ fn cmp(&self, other: &BTreeMap<K, V>) -> Ordering {
#[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, ", ")); }
......
......@@ -613,7 +613,7 @@ fn bitor(self, rhs: &BTreeSet<T>) -> 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 @@ fn test_show() {
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), "{}");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册