aboutsummaryrefslogtreecommitdiff
path: root/src/message/signalproxy/rpccall
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/message/signalproxy/rpccall/bufferinfo.rs2
-rw-r--r--src/message/signalproxy/rpccall/client.rs2
-rw-r--r--src/message/signalproxy/rpccall/identity.rs10
-rw-r--r--src/message/signalproxy/rpccall/message.rs10
-rw-r--r--src/message/signalproxy/rpccall/mod.rs2
-rw-r--r--src/message/signalproxy/rpccall/network.rs10
-rw-r--r--src/message/signalproxy/rpccall/objectrenamed.rs6
-rw-r--r--src/message/signalproxy/rpccall/passwordchange.rs12
8 files changed, 27 insertions, 27 deletions
diff --git a/src/message/signalproxy/rpccall/bufferinfo.rs b/src/message/signalproxy/rpccall/bufferinfo.rs
index 7ba2757..cc8ad3a 100644
--- a/src/message/signalproxy/rpccall/bufferinfo.rs
+++ b/src/message/signalproxy/rpccall/bufferinfo.rs
@@ -28,7 +28,7 @@ impl RpcCallType for BufferInfoUpdated {
Ok((
size,
Self {
- buffer: match_variant!(input.remove(0), Variant::BufferInfo),
+ buffer: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/client.rs b/src/message/signalproxy/rpccall/client.rs
index 5fb5326..818b32c 100644
--- a/src/message/signalproxy/rpccall/client.rs
+++ b/src/message/signalproxy/rpccall/client.rs
@@ -29,7 +29,7 @@ impl RpcCallType for KickClient {
Ok((
size,
Self {
- id: match_variant!(input.remove(0), Variant::i32),
+ id: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/identity.rs b/src/message/signalproxy/rpccall/identity.rs
index 288dec5..1672e98 100644
--- a/src/message/signalproxy/rpccall/identity.rs
+++ b/src/message/signalproxy/rpccall/identity.rs
@@ -34,8 +34,8 @@ impl RpcCallType for CreateIdentity {
Ok((
size,
CreateIdentity {
- identity: match_variant!(input.remove(0), Variant::Identity),
- additional: match_variant!(input.remove(0), Variant::VariantMap),
+ identity: input.remove(0).try_into().unwrap(),
+ additional: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -68,7 +68,7 @@ impl RpcCallType for RemoveIdentity {
Ok((
size,
Self {
- identity_id: match_variant!(input.remove(0), Variant::IdentityId),
+ identity_id: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -101,7 +101,7 @@ impl RpcCallType for IdentityCreated {
Ok((
size,
IdentityCreated {
- identity: match_variant!(input.remove(0), Variant::Identity),
+ identity: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -134,7 +134,7 @@ impl RpcCallType for IdentityRemoved {
Ok((
size,
Self {
- identity_id: match_variant!(input.remove(0), Variant::IdentityId),
+ identity_id: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/message.rs b/src/message/signalproxy/rpccall/message.rs
index 93888b5..bf0629a 100644
--- a/src/message/signalproxy/rpccall/message.rs
+++ b/src/message/signalproxy/rpccall/message.rs
@@ -29,7 +29,7 @@ impl RpcCallType for DisplayMessage {
Ok((
size,
RpcCall::DisplayMessage(DisplayMessage {
- message: match_variant!(input.remove(0), Variant::Message),
+ message: input.remove(0).try_into().unwrap(),
}),
))
}
@@ -64,8 +64,8 @@ impl RpcCallType for DisplayStatusMessage {
Ok((
size,
DisplayStatusMessage {
- network: match_variant!(input.remove(0), Variant::String),
- message: match_variant!(input.remove(0), Variant::String),
+ network: input.remove(0).try_into().unwrap(),
+ message: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -100,8 +100,8 @@ impl RpcCallType for SendInput {
Ok((
size,
Self {
- buffer: match_variant!(input.remove(0), Variant::BufferInfo),
- message: match_variant!(input.remove(0), Variant::String),
+ buffer: input.remove(0).try_into().unwrap(),
+ message: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/mod.rs b/src/message/signalproxy/rpccall/mod.rs
index 378d626..c30d462 100644
--- a/src/message/signalproxy/rpccall/mod.rs
+++ b/src/message/signalproxy/rpccall/mod.rs
@@ -110,7 +110,7 @@ impl Deserialize for RpcCall {
res.remove(0);
- let rpc = match_variant!(res.remove(0), Variant::ByteArray);
+ let rpc: String = res.remove(0).try_into().unwrap();
match rpc.as_str() {
DisplayMessage::NAME => DisplayMessage::from_network(size, &mut res),
diff --git a/src/message/signalproxy/rpccall/network.rs b/src/message/signalproxy/rpccall/network.rs
index 18f9f74..aeb3f80 100644
--- a/src/message/signalproxy/rpccall/network.rs
+++ b/src/message/signalproxy/rpccall/network.rs
@@ -33,8 +33,8 @@ impl RpcCallType for CreateNetwork {
Ok((
size,
Self {
- network: match_variant!(input.remove(0), Variant::NetworkInfo),
- channels: match_variant!(input.remove(0), Variant::StringList),
+ network: input.remove(0).try_into().unwrap(),
+ channels: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -67,7 +67,7 @@ impl RpcCallType for RemoveNetwork {
Ok((
size,
Self {
- network_id: match_variant!(input.remove(0), Variant::NetworkId),
+ network_id: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -100,7 +100,7 @@ impl RpcCallType for NetworkCreated {
Ok((
size,
Self {
- network_id: match_variant!(input.remove(0), Variant::NetworkId),
+ network_id: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -133,7 +133,7 @@ impl RpcCallType for NetworkRemoved {
Ok((
size,
Self {
- network_id: match_variant!(input.remove(0), Variant::NetworkId),
+ network_id: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/objectrenamed.rs b/src/message/signalproxy/rpccall/objectrenamed.rs
index d103345..1d698ef 100644
--- a/src/message/signalproxy/rpccall/objectrenamed.rs
+++ b/src/message/signalproxy/rpccall/objectrenamed.rs
@@ -33,9 +33,9 @@ impl RpcCallType for ObjectRenamed {
Ok((
size,
Self {
- classname: match_variant!(input.remove(0), Variant::ByteArray),
- oldname: match_variant!(input.remove(0), Variant::String),
- newname: match_variant!(input.remove(0), Variant::String),
+ classname: input.remove(0).try_into().unwrap(),
+ oldname: input.remove(0).try_into().unwrap(),
+ newname: input.remove(0).try_into().unwrap(),
}
.into(),
))
diff --git a/src/message/signalproxy/rpccall/passwordchange.rs b/src/message/signalproxy/rpccall/passwordchange.rs
index 38bfc97..b96b926 100644
--- a/src/message/signalproxy/rpccall/passwordchange.rs
+++ b/src/message/signalproxy/rpccall/passwordchange.rs
@@ -38,10 +38,10 @@ impl RpcCallType for ChangePassword {
Ok((
size,
Self {
- peer: match_variant!(input.remove(0), Variant::PeerPtr),
- user: match_variant!(input.remove(0), Variant::String),
- before: match_variant!(input.remove(0), Variant::String),
- after: match_variant!(input.remove(0), Variant::String),
+ peer: input.remove(0).try_into().unwrap(),
+ user: input.remove(0).try_into().unwrap(),
+ before: input.remove(0).try_into().unwrap(),
+ after: input.remove(0).try_into().unwrap(),
}
.into(),
))
@@ -79,8 +79,8 @@ impl RpcCallType for PasswordChanged {
Ok((
size,
Self {
- peer: match_variant!(input.remove(0), Variant::PeerPtr),
- success: match_variant!(input.remove(0), Variant::bool),
+ peer: input.remove(0).try_into().unwrap(),
+ success: input.remove(0).try_into().unwrap(),
}
.into(),
))