Avoid Arc::try_unwrap which causes a panic when multiple clients are connected

This commit is contained in:
R Tyler Croy 2020-01-04 21:53:46 -08:00
parent 8d520a156d
commit 57722f9489
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
2 changed files with 2 additions and 3 deletions

View File

@ -46,7 +46,7 @@ pub enum Output {
#[derive(Serialize, Deserialize, Debug, Message)]
#[rtype(result = "()")]
pub struct OutputMessage {
pub msg: Output,
pub msg: Arc<Output>,
pub meta: Meta,
}

View File

@ -73,8 +73,7 @@ impl Handler<eventbus::Event> for WSClient {
ts: Utc::now(),
};
let out = OutputMessage {
// TODO: error
msg: Arc::try_unwrap(event.e).unwrap(),
msg: event.e,
meta,
};
// TODO: error