good structure
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
use mongodb::bson::doc;
|
||||
|
||||
use crate::response::{Response, Result};
|
||||
|
||||
use super::Session;
|
||||
|
||||
pub fn player(session: &Session, uuid: String) -> Result {
|
||||
let player = session
|
||||
.database
|
||||
.players
|
||||
.find(doc! {
|
||||
"uuid": uuid.clone(),
|
||||
})
|
||||
.run()?
|
||||
.deserialize_current()
|
||||
.unwrap();
|
||||
|
||||
Ok(Response::Player {
|
||||
cloak: player.cloak,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user