Panic on unserializable packets

This commit is contained in:
Joscha 2022-02-13 01:10:37 +01:00
parent 59eff03ae9
commit cea0c2e847

View file

@ -43,8 +43,8 @@ impl fmt::Debug for ConnTx {
impl ConnTx {
pub fn send(&self, packet: &Packet) -> Result<()> {
let msg = Message::Text(serde_json::to_string(packet)?);
self.tx.send(msg)?;
let str = serde_json::to_string(packet).expect("unserializable packet");
self.tx.send(Message::Text(str))?;
Ok(())
}
}