diff --git a/src/euph/api/packet.rs b/src/euph/api/packet.rs index dcc84d8..0d5b47d 100644 --- a/src/euph/api/packet.rs +++ b/src/euph/api/packet.rs @@ -37,7 +37,7 @@ macro_rules! packets { }) } - pub fn to_value(self) -> serde_json::Result { + pub fn into_value(self) -> serde_json::Result { Ok(match self{ $( Self::$name(p) => serde_json::to_value(p)?, )* Self::Unimplemented => panic!("using unimplemented data"), @@ -46,7 +46,7 @@ macro_rules! packets { pub fn packet_type(&self) -> PacketType { match self { - $( Self::$name(p) => PacketType::$name, )* + $( Self::$name(_) => PacketType::$name, )* Self::Unimplemented => panic!("using unimplemented data"), } } @@ -194,7 +194,7 @@ impl ParsedPacket { }) } - pub fn to_packet(self) -> serde_json::Result { + pub fn into_packet(self) -> serde_json::Result { let id = self.id; let r#type = self.r#type; let throttled = self.throttled.is_some(); @@ -204,7 +204,7 @@ impl ParsedPacket { Ok(data) => Packet { id, r#type, - data: Some(data.to_value()?), + data: Some(data.into_value()?), error: None, throttled, throttled_reason, diff --git a/src/euph/api/room_cmds.rs b/src/euph/api/room_cmds.rs index f4653e3..02dddd4 100644 --- a/src/euph/api/room_cmds.rs +++ b/src/euph/api/room_cmds.rs @@ -46,14 +46,6 @@ pub struct Nick { pub name: String, } -impl Nick { - pub fn new(name: S) -> Self { - Self { - name: name.to_string(), - } - } -} - /// Confirms the [`Nick`] command. /// /// Returns the session's former and new names (the server may modify the @@ -106,22 +98,6 @@ pub struct Send { pub parent: Option, } -impl Send { - pub fn new(content: S) -> Self { - Self { - content: content.to_string(), - parent: None, - } - } - - pub fn reply(parent: Snowflake, content: S) -> Self { - Self { - content: content.to_string(), - parent: Some(parent), - } - } -} - /// The message that was sent. /// /// this includes the message id, which was populated by the server. diff --git a/src/euph/conn.rs b/src/euph/conn.rs index 7465ef0..254de71 100644 --- a/src/euph/conn.rs +++ b/src/euph/conn.rs @@ -311,7 +311,7 @@ impl State { content: Ok(data), throttled: None, } - .to_packet()?; + .into_packet()?; let msg = tungstenite::Message::Text(serde_json::to_string(&packet)?); self.ws_tx.send(msg).await?; @@ -328,7 +328,7 @@ impl State { content: Ok(data), throttled: None, } - .to_packet()?; + .into_packet()?; let msg = tungstenite::Message::Text(serde_json::to_string(&packet)?); self.ws_tx.send(msg).await?; @@ -369,6 +369,7 @@ impl State { #[derive(Debug, Clone)] pub struct ConnTx { + #[allow(dead_code)] canary: mpsc::UnboundedSender, event_tx: mpsc::UnboundedSender, } @@ -411,6 +412,7 @@ impl ConnTx { #[derive(Debug)] pub struct ConnRx { + #[allow(dead_code)] canary: oneshot::Sender, packet_rx: mpsc::UnboundedReceiver, } diff --git a/src/euph/room.rs b/src/euph/room.rs index 4c27caf..9ea9843 100644 --- a/src/euph/room.rs +++ b/src/euph/room.rs @@ -179,6 +179,7 @@ impl State { #[derive(Debug)] pub struct Room { + #[allow(dead_code)] canary: oneshot::Sender, event_tx: mpsc::UnboundedSender, }