Use stable 'parking_lot::const_mutex()' in todo.

This commit is contained in:
Sergio Benitez 2021-05-18 20:59:01 -07:00
parent 21a396c10d
commit f939439911
3 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ diesel_migrations = "1.3"
log = "0.4"
[dev-dependencies]
parking_lot = { version = "0.10", features = ["nightly"] }
parking_lot = "0.11"
rand = "0.6"
[dependencies.rocket_contrib]

View File

@ -13,8 +13,8 @@ mod schema {
use self::schema::tasks;
use self::schema::tasks::dsl::{tasks as all_tasks, completed as task_completed};
#[table_name="tasks"]
#[derive(Serialize, Queryable, Insertable, Debug, Clone)]
#[table_name="tasks"]
pub struct Task {
pub id: Option<i32>,
pub description: String,

View File

@ -2,7 +2,7 @@ extern crate parking_lot;
extern crate rand;
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 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.
// For now. In the future, we'll have a nice way to run each test in a DB
// transaction so we can regain concurrency.
static DB_LOCK: Mutex<()> = Mutex::new(());
static DB_LOCK: Mutex<()> = const_mutex(());
macro_rules! run_test {
(|$client:ident, $conn:ident| $block:expr) => ({