aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-03-04 17:22:15 +0100
committerHarald Eilertsen <haraldei@anduin.net>2019-03-04 17:22:15 +0100
commit14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a (patch)
treeb38dd2e7fb3dcb0186c478b5dd2b3b22733eb273 /src
parent1f89095fc559c0686aa7e79340c29c7f5a04658b (diff)
downloadramaskrik-social-14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a.tar.gz
ramaskrik-social-14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a.tar.bz2
ramaskrik-social-14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a.zip
Use rocket_contrib's JsonValue as return type.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 09e092c..e6bb0f6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -19,12 +19,13 @@
use rocket::{
get,
- response::content::Json,
routes,
};
use rocket_contrib::{
database,
databases::diesel,
+ json,
+ json::JsonValue,
};
use std::collections::HashMap;
use std::error::Error;
@@ -34,8 +35,8 @@ use std::result::Result;
struct DbConn(diesel::PgConnection);
#[get("/")]
-fn get_rooms(_db: DbConn) -> Json<String> {
- Json("[]".into())
+fn get_rooms(_db: DbConn) -> JsonValue {
+ json!([])
}
pub fn build_rocket() -> Result<rocket::Rocket, Box<dyn Error>> {