use rocket_contrib::Json; use serde_json; use plume_models::db_conn::DbConn; use plume_models::posts::Post; #[get("/posts/")] fn get(id: i32, conn: DbConn) -> Json { let post = Post::get(&*conn, id).unwrap(); Json(post.to_json(&*conn)) }