Improve Debug formatting of the thread name.
This commit is contained in:
parent
04abf066f1
commit
bc9d007e3e
1 changed files with 2 additions and 6 deletions
|
|
@ -132,13 +132,9 @@ impl<'mir, 'tcx> Thread<'mir, 'tcx> {
|
|||
impl<'mir, 'tcx> std::fmt::Debug for Thread<'mir, 'tcx> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if let Some(ref name) = self.thread_name {
|
||||
if let Ok(name_str) = std::str::from_utf8(name) {
|
||||
write!(f, "{}", name_str)?;
|
||||
} else {
|
||||
write!(f, "<invalid thread name>")?;
|
||||
}
|
||||
write!(f, "{}", String::from_utf8_lossy(name))?;
|
||||
} else {
|
||||
write!(f, "unnamed")?;
|
||||
write!(f, "<unnamed>")?;
|
||||
}
|
||||
write!(f, "({:?}, {:?})", self.state, self.join_status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue