diff --git a/examples/todo/Cargo.toml b/examples/todo/Cargo.toml index e8022de0..3f3c05fe 100644 --- a/examples/todo/Cargo.toml +++ b/examples/todo/Cargo.toml @@ -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] diff --git a/examples/todo/src/task.rs b/examples/todo/src/task.rs index 4d369172..97ed55d4 100644 --- a/examples/todo/src/task.rs +++ b/examples/todo/src/task.rs @@ -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, pub description: String, diff --git a/examples/todo/src/tests.rs b/examples/todo/src/tests.rs index a9ca6bae..448e7488 100644 --- a/examples/todo/src/tests.rs +++ b/examples/todo/src/tests.rs @@ -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) => ({