forked from Roflin/gamenight
Implemented leaving a gamenight on the server/database side
This commit is contained in:
1 parent
db6f55bc47
commit
d11e31149b
5 files changed
+49
-3
No files matched your search
@@ -1,7 +1,16 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct User {
|
||||
pub id: Uuid,
|
||||
pub username: String
|
||||
}
|
||||
|
||||
impl Display for User {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.username)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ impl ViewGamenight {
|
||||
|
||||
fn vec_user_to_usernames_string(users: Vec<User>) -> String {
|
||||
|
||||
let string_list: Vec<String> = users.iter().map(|x| {x.username.clone()}).collect();
|
||||
let string_list: Vec<String> = users.iter().map(|x| {format!("{}", x)}).collect();
|
||||
string_list.join(", ")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user