remove panic from Debug of StreamRef is mutex is poisoned
This commit is contained in:
@@ -734,12 +734,20 @@ where
|
|||||||
P: Peer,
|
P: Peer,
|
||||||
{
|
{
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let me = self.inner.lock().unwrap();
|
match self.inner.lock() {
|
||||||
let stream = &me.store[self.key];
|
Ok(me) => {
|
||||||
fmt.debug_struct("StreamRef")
|
let stream = &me.store[self.key];
|
||||||
.field("stream_id", &stream.id)
|
fmt.debug_struct("StreamRef")
|
||||||
.field("ref_count", &stream.ref_count)
|
.field("stream_id", &stream.id)
|
||||||
.finish()
|
.field("ref_count", &stream.ref_count)
|
||||||
|
.finish()
|
||||||
|
},
|
||||||
|
Err(_poisoned) => {
|
||||||
|
fmt.debug_struct("StreamRef")
|
||||||
|
.field("inner", &"<Poisoned>")
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user