cargo fmt
This commit is contained in:
parent
ed11799bf5
commit
c4eece7ffd
8 changed files with 113 additions and 53 deletions
|
@ -13,11 +13,11 @@
|
|||
|
||||
use crate::room::Room;
|
||||
|
||||
use std::cmp::{PartialEq, Eq};
|
||||
use simple_websockets::{Message, Responder};
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::{Eq, PartialEq};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
use simple_websockets::{Responder, Message};
|
||||
|
||||
pub struct DiscordInfo {
|
||||
pub username: String,
|
||||
|
@ -47,7 +47,9 @@ pub enum ClientInfo {
|
|||
impl ClientInfo {
|
||||
fn id(&self) -> u64 {
|
||||
match self {
|
||||
Self::Ws { id, discord_info, .. } => match discord_info {
|
||||
Self::Ws {
|
||||
id, discord_info, ..
|
||||
} => match discord_info {
|
||||
// Discord-verified websocket connection
|
||||
Some(discord_info) => discord_info.id,
|
||||
// Anonymous websocket connection
|
||||
|
@ -93,7 +95,9 @@ impl Client {
|
|||
pub fn send(&self, message: Message) -> bool {
|
||||
match &self.info {
|
||||
ClientInfo::Ws { responder, .. } => responder.send(message),
|
||||
ClientInfo::Discord { .. } => unimplemented!("no networking implementation for Discord connections"),
|
||||
ClientInfo::Discord { .. } => {
|
||||
unimplemented!("no networking implementation for Discord connections")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue