Skip to content

Commit ba21e0b

Browse files
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.
1 parent ef4d1c4 commit ba21e0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libstd/thread/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,10 @@ impl Thread {
12561256
#[stable(feature = "rust1", since = "1.0.0")]
12571257
impl fmt::Debug for Thread {
12581258
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1259-
fmt::Debug::fmt(&self.name(), f)
1259+
f.debug_struct("Thread")
1260+
.field("id", &self.id())
1261+
.field("name", &self.name())
1262+
.finish()
12601263
}
12611264
}
12621265

0 commit comments

Comments
 (0)