Simplify Debug
for {EnumSet, VecDeque}
This commit is contained in:
parent
5ca60d9431
commit
db18718809
@ -49,16 +49,7 @@ impl<E> Clone for EnumSet<E> {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<E:CLike + fmt::Debug> fmt::Debug for EnumSet<E> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(fmt, "{{"));
|
||||
let mut first = true;
|
||||
for e in self {
|
||||
if !first {
|
||||
try!(write!(fmt, ", "));
|
||||
}
|
||||
try!(write!(fmt, "{:?}", e));
|
||||
first = false;
|
||||
}
|
||||
write!(fmt, "}}")
|
||||
fmt.debug_set().entries(self).finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1787,14 +1787,7 @@ impl<'a, T: 'a + Copy> Extend<&'a T> for VecDeque<T> {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(f, "["));
|
||||
|
||||
for (i, e) in self.iter().enumerate() {
|
||||
if i != 0 { try!(write!(f, ", ")); }
|
||||
try!(write!(f, "{:?}", *e));
|
||||
}
|
||||
|
||||
write!(f, "]")
|
||||
f.debug_list().entries(self).finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user