Browse Source

Remove warnings in client.

wip
Titouan Rigoudy 4 years ago
parent
commit
4d4e9c7ecd
3 changed files with 9 additions and 0 deletions
  1. +5
    -0
      client/src/main.rs
  2. +1
    -0
      client/src/room.rs
  3. +3
    -0
      client/src/user.rs

+ 5
- 0
client/src/main.rs View File

@ -9,12 +9,17 @@ use env_logger;
use solstice_proto; use solstice_proto;
mod client; mod client;
#[cfg(test)]
mod context; mod context;
mod control; mod control;
#[cfg(test)]
mod dispatcher; mod dispatcher;
#[cfg(test)]
mod executor; mod executor;
#[cfg(test)]
mod handlers; mod handlers;
mod login; mod login;
#[cfg(test)]
mod message_handler; mod message_handler;
mod room; mod room;
mod user; mod user;


+ 1
- 0
client/src/room.rs View File

@ -134,6 +134,7 @@ impl RoomMap {
/// Looks up the given room name in the map, returning an immutable /// Looks up the given room name in the map, returning an immutable
/// reference to the associated data if found, or an error if not found. /// reference to the associated data if found, or an error if not found.
#[cfg(test)]
fn get_strict(&self, room_name: &str) -> Result<&Room, Error> { fn get_strict(&self, room_name: &str) -> Result<&Room, Error> {
match self.map.get(room_name) { match self.map.get(room_name) {
Some(room) => Ok(room), Some(room) => Ok(room),


+ 3
- 0
client/src/user.rs View File

@ -44,6 +44,7 @@ impl UserMap {
/// Looks up the given user name in the map, returning an immutable /// Looks up the given user name in the map, returning an immutable
/// reference to the associated data if found. /// reference to the associated data if found.
#[cfg(test)]
pub fn get(&self, user_name: &str) -> Option<&User> { pub fn get(&self, user_name: &str) -> Option<&User> {
self.map.get(user_name) self.map.get(user_name)
} }
@ -97,6 +98,7 @@ impl UserMap {
} }
/// Returns a copy of the set of privileged users. /// Returns a copy of the set of privileged users.
#[cfg(test)]
pub fn get_all_privileged(&self) -> Vec<String> { pub fn get_all_privileged(&self) -> Vec<String> {
self.privileged.iter().map(|s| s.to_string()).collect() self.privileged.iter().map(|s| s.to_string()).collect()
} }
@ -112,6 +114,7 @@ impl UserMap {
} }
/// Checks if the given user is privileged. /// Checks if the given user is privileged.
#[cfg(test)]
pub fn is_privileged(&self, user_name: &str) -> bool { pub fn is_privileged(&self, user_name: &str) -> bool {
self.privileged.contains(user_name) self.privileged.contains(user_name)
} }


Loading…
Cancel
Save