Fixed immediate warnings
This commit is contained in:
parent
1ecccf6d67
commit
e082971df0
|
|
@ -32,7 +32,7 @@ impl ClientManager {
|
|||
|
||||
let channels = unbounded();
|
||||
|
||||
let mut manager_ref: Arc<Self> = Arc::new(ClientManager {
|
||||
let manager_ref: Arc<Self> = Arc::new(ClientManager {
|
||||
clients: Mutex::default(),
|
||||
|
||||
weak_self: Mutex::default(),
|
||||
|
|
@ -63,15 +63,15 @@ impl ClientManager {
|
|||
}
|
||||
|
||||
impl TClientManager<Client, ClientMessage> for ClientManager {
|
||||
fn addClient(&self, Client: std::sync::Arc<Client>) {
|
||||
self.clients.lock().unwrap().push(Client);
|
||||
fn add_client(&self, client: std::sync::Arc<Client>) {
|
||||
self.clients.lock().unwrap().push(client);
|
||||
}
|
||||
|
||||
fn removeClient(&self, uuid: Uuid) {
|
||||
fn remove_client(&self, _uuid: Uuid) {
|
||||
self.clients.lock().unwrap().sort();
|
||||
}
|
||||
|
||||
fn messageClient(&self, id: Uuid, msg: ClientMessage) {
|
||||
fn message_client(&self, _id: Uuid, _msg: ClientMessage) {
|
||||
todo!()
|
||||
}
|
||||
fn tick(&self) {
|
||||
|
|
@ -86,9 +86,9 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_get_ref() {
|
||||
let mut clientManager = ClientManager::new();
|
||||
let cm_ref = clientManager.get_ref();
|
||||
assert_eq!(Arc::weak_count(&clientManager), 2);
|
||||
let client_manager = ClientManager::new();
|
||||
let _cm_ref = client_manager.get_ref();
|
||||
assert_eq!(Arc::weak_count(&client_manager), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ use std::sync::Arc;
|
|||
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::client::traits;
|
||||
|
||||
/**
|
||||
* @michael-bailey
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ pub mod client_management;
|
|||
// pub mod server;
|
||||
// pub mod server_v3;
|
||||
|
||||
pub struct Server {}
|
||||
pub struct _Server {}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
mod lib;
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
use lib::server::Server;
|
||||
|
||||
fn main() {
|
||||
let args = App::new("--rust chat server--")
|
||||
let _args = App::new("--rust chat server--")
|
||||
.version("0.1.5")
|
||||
.author("Mitchel Hardie <mitch161>, Michael Bailey <michael-bailey>")
|
||||
.about("this is a chat server developed in rust, depending on the version one of two implementations will be used")
|
||||
.arg(
|
||||
Arg::with_name("config")
|
||||
Arg::new("config")
|
||||
.short('p')
|
||||
.long("port")
|
||||
.value_name("PORT")
|
||||
|
|
|
|||
Loading…
Reference in New Issue