From a48d7bcc68887cbbbe281fd621e13d304da85674 Mon Sep 17 00:00:00 2001 From: ntr Date: Sat, 8 Sep 2018 00:32:30 +1000 Subject: [PATCH] comments --- src/rpc.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index 876ef1cf..6f8bb352 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -20,8 +20,10 @@ pub struct GenerateParams { impl Rpc { pub fn receive(&self, msg: Message) -> StdResult, RpcError> { - // specify rpc message as the resulting type + // consume the ws data into bytes let data = msg.into_data(); + + // cast the msg to this type to receive method name match from_slice::(&data) { Ok(v) => { @@ -53,11 +55,6 @@ pub enum RpcError { UnknownMethod, } -#[derive(Debug,Clone,Serialize,Deserialize)] -enum RpcParam { - GenerateParams { level: u16 }, -} - #[cfg(test)] mod tests { use super::*;