diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-03-04 17:22:15 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-03-04 17:22:15 +0100 |
commit | 14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a (patch) | |
tree | b38dd2e7fb3dcb0186c478b5dd2b3b22733eb273 /src | |
parent | 1f89095fc559c0686aa7e79340c29c7f5a04658b (diff) | |
download | ramaskrik-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.rs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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>> { |