aboutsummaryrefslogtreecommitdiff
path: root/src/client/connection.rs
diff options
context:
space:
mode:
authorHenauxg <19689618+Henauxg@users.noreply.github.com>2023-01-21 12:06:41 +0100
committerHenauxg <19689618+Henauxg@users.noreply.github.com>2023-01-21 12:06:41 +0100
commit7e66161cbc7cee5a4010458fe54d116a05e6126a (patch)
treea6db47277353abca0df189da8641e69406e98c50 /src/client/connection.rs
parent919e5427766fad3be301dccb13cfee46c14bd8d5 (diff)
[client & server] Channels only accept Bytes, clone Bytes instead of Vec in send_group_message
Diffstat (limited to 'src/client/connection.rs')
-rw-r--r--src/client/connection.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/connection.rs b/src/client/connection.rs
index 0205ba5..f7538f6 100644
--- a/src/client/connection.rs
+++ b/src/client/connection.rs
@@ -169,7 +169,7 @@ impl Connection {
ConnectionState::Disconnected => Err(QuinnetError::ConnectionClosed),
_ => match self.channels.get(&channel_id) {
Some(channel) => match bincode::serialize(&message) {
- Ok(payload) => channel.send_payload(payload),
+ Ok(payload) => channel.send_payload(payload.into()),
Err(_) => Err(QuinnetError::Serialization),
},
None => Err(QuinnetError::UnknownChannel(channel_id)),
@@ -208,7 +208,7 @@ impl Connection {
match &self.state {
ConnectionState::Disconnected => Err(QuinnetError::ConnectionClosed),
_ => match self.channels.get(&channel_id) {
- Some(channel) => channel.send_payload(payload),
+ Some(channel) => channel.send_payload(payload.into()),
None => Err(QuinnetError::UnknownChannel(channel_id)),
},
}