Include id in Thread's Debug implementation

Since Rust 1.19.0, id is a stable method, so there is no reason to
not include it in Debug implementation.
This commit is contained in:
Konrad Borowski 2019-03-27 12:28:17 +01:00
parent ef4d1c4195
commit ba21e0b368

View File

@ -1256,7 +1256,10 @@ impl Thread {
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for Thread {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(&self.name(), f)
f.debug_struct("Thread")
.field("id", &self.id())
.field("name", &self.name())
.finish()
}
}