mirror of https://github.com/rwf2/Rocket.git
Use stable 'parking_lot::const_mutex()' in todo.
This commit is contained in:
parent
21a396c10d
commit
f939439911
|
@ -14,7 +14,7 @@ diesel_migrations = "1.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
parking_lot = { version = "0.10", features = ["nightly"] }
|
parking_lot = "0.11"
|
||||||
rand = "0.6"
|
rand = "0.6"
|
||||||
|
|
||||||
[dependencies.rocket_contrib]
|
[dependencies.rocket_contrib]
|
||||||
|
|
|
@ -13,8 +13,8 @@ mod schema {
|
||||||
use self::schema::tasks;
|
use self::schema::tasks;
|
||||||
use self::schema::tasks::dsl::{tasks as all_tasks, completed as task_completed};
|
use self::schema::tasks::dsl::{tasks as all_tasks, completed as task_completed};
|
||||||
|
|
||||||
#[table_name="tasks"]
|
|
||||||
#[derive(Serialize, Queryable, Insertable, Debug, Clone)]
|
#[derive(Serialize, Queryable, Insertable, Debug, Clone)]
|
||||||
|
#[table_name="tasks"]
|
||||||
pub struct Task {
|
pub struct Task {
|
||||||
pub id: Option<i32>,
|
pub id: Option<i32>,
|
||||||
pub description: String,
|
pub description: String,
|
||||||
|
|
|
@ -2,7 +2,7 @@ extern crate parking_lot;
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
|
||||||
use super::task::Task;
|
use super::task::Task;
|
||||||
use self::parking_lot::Mutex;
|
use self::parking_lot::{Mutex, const_mutex};
|
||||||
use self::rand::{Rng, thread_rng, distributions::Alphanumeric};
|
use self::rand::{Rng, thread_rng, distributions::Alphanumeric};
|
||||||
|
|
||||||
use rocket::local::Client;
|
use rocket::local::Client;
|
||||||
|
@ -11,7 +11,7 @@ use rocket::http::{Status, ContentType};
|
||||||
// We use a lock to synchronize between tests so DB operations don't collide.
|
// We use a lock to synchronize between tests so DB operations don't collide.
|
||||||
// For now. In the future, we'll have a nice way to run each test in a DB
|
// For now. In the future, we'll have a nice way to run each test in a DB
|
||||||
// transaction so we can regain concurrency.
|
// transaction so we can regain concurrency.
|
||||||
static DB_LOCK: Mutex<()> = Mutex::new(());
|
static DB_LOCK: Mutex<()> = const_mutex(());
|
||||||
|
|
||||||
macro_rules! run_test {
|
macro_rules! run_test {
|
||||||
(|$client:ident, $conn:ident| $block:expr) => ({
|
(|$client:ident, $conn:ident| $block:expr) => ({
|
||||||
|
|
Loading…
Reference in New Issue