removed return for client struct
the client struct that gets returned from hashmap when removed no longer needs to be passed back up the stack frame as client is now passed by a self reference
This commit is contained in:
parent
35d391eb8a
commit
ef62657571
|
|
@ -0,0 +1,11 @@
|
|||
use crate::server::client::client_profile::Client;
|
||||
//use crate::client_management::client_profile::Client;
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub fn remove_client(clients_ref: &Arc<Mutex<HashMap<String, Client>>>, client: &Client){
|
||||
let mut clients_hashmap = clients_ref.lock().unwrap();
|
||||
clients_hashmap.remove(client.get_uuid()).unwrap();
|
||||
}
|
||||
Loading…
Reference in New Issue