diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2019-03-27 12:28:17 +0100 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2019-03-27 12:28:17 +0100 |
| commit | ba21e0b368d891102c299afe1410dd886598cda4 (patch) | |
| tree | dedbe3e3dc75817c707a4fd4c75c807141af1a3c /src/libstd/thread | |
| parent | ef4d1c419525e1510aa650e2bec0d8f7449a2130 (diff) | |
| download | rust-ba21e0b368d891102c299afe1410dd886598cda4.tar.gz rust-ba21e0b368d891102c299afe1410dd886598cda4.zip | |
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.
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 08f0aa2f0d2..63fa46e2edd 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -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() } } |
