forked from jmug/stoatchat
Update to mongo 1.1.0-beta, start reset + migrations
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use bson::{doc, from_bson, Document};
|
||||
use mongodb::bson::{Bson, doc, from_bson, Document};
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket::http::{RawStr, Status};
|
||||
use rocket::request::{self, FromParam, FromRequest, Request};
|
||||
@@ -143,7 +143,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for User {
|
||||
|
||||
if let Some(user) = result {
|
||||
Outcome::Success(
|
||||
from_bson(bson::Bson::Document(user)).expect("Failed to unwrap user."),
|
||||
from_bson(Bson::Document(user)).expect("Failed to unwrap user."),
|
||||
)
|
||||
} else {
|
||||
Outcome::Failure((Status::Forbidden, AuthError::Invalid))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use bson::{doc, from_bson, Bson, Document};
|
||||
use mongodb::bson::{doc, from_bson, Bson, Document};
|
||||
use mongodb::options::FindOneOptions;
|
||||
use rocket::http::RawStr;
|
||||
use rocket::request::FromParam;
|
||||
@@ -36,7 +36,7 @@ impl GuildRef {
|
||||
) {
|
||||
Ok(result) => match result {
|
||||
Some(doc) => {
|
||||
Some(from_bson(bson::Bson::Document(doc)).expect("Failed to unwrap guild."))
|
||||
Some(from_bson(mongodb::bson::mongodb::bson::Document(doc)).expect("Failed to unwrap guild."))
|
||||
}
|
||||
None => None,
|
||||
},
|
||||
@@ -85,7 +85,7 @@ pub fn get_member(guild_id: &String, member: &String) -> Option<Member> {
|
||||
None,
|
||||
) {
|
||||
if let Some(doc) = result {
|
||||
Some(from_bson(Bson::Document(doc)).expect("Failed to unwrap member."))
|
||||
Some(from_bson(mongodb::bson::Document(doc)).expect("Failed to unwrap member."))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -142,7 +142,7 @@ pub fn get_invite<U: Into<Option<String>>>(
|
||||
Some((
|
||||
doc.get_str("_id").unwrap().to_string(),
|
||||
doc.get_str("name").unwrap().to_string(),
|
||||
from_bson(Bson::Document(invite.clone())).unwrap(),
|
||||
from_bson(mongodb::bson::Document(invite.clone())).unwrap(),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user