mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws_protocol: clean up, run rustfmt
This commit is contained in:
parent
d2595e9746
commit
7ae7442284
1 changed files with 5 additions and 9 deletions
|
|
@ -27,16 +27,12 @@ impl InMessage {
|
|||
|
||||
match ws_message {
|
||||
Message::Text(mut text) => {
|
||||
::simd_json::serde::from_str(&mut text)
|
||||
.context("deserialize from text xwith serde")
|
||||
},
|
||||
Message::Binary(mut bytes) => {
|
||||
::simd_json::serde::from_slice(&mut bytes[..])
|
||||
.context("deserialize from binary with serde")
|
||||
},
|
||||
_ => {
|
||||
Err(anyhow::anyhow!("Message is neither text nor binary"))
|
||||
::simd_json::serde::from_str(&mut text).context("deserialize with serde")
|
||||
}
|
||||
Message::Binary(mut bytes) => {
|
||||
::simd_json::serde::from_slice(&mut bytes[..]).context("deserialize with serde")
|
||||
}
|
||||
_ => Err(anyhow::anyhow!("Message is neither text nor binary")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue