diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-12-23 13:03:23 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-12-23 13:03:23 +0100 |
commit | 33b5c759c18b249f85d06d08e3228e0d1e8e2182 (patch) | |
tree | f1259fcfa5c9b02965d4d067ea9ea3f540524fc8 /src/main.rs | |
parent | 6109a230ca65cd9a113df72d36247235fe934de4 (diff) | |
download | rocket-blog-33b5c759c18b249f85d06d08e3228e0d1e8e2182.tar.gz rocket-blog-33b5c759c18b249f85d06d08e3228e0d1e8e2182.tar.bz2 rocket-blog-33b5c759c18b249f85d06d08e3228e0d1e8e2182.zip |
Move get_post into impl and rename.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 84fe239..4aa448d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,12 +24,12 @@ implement_responder_for!(IndexTemplate<'a>); #[get("/", format = "text/html")] fn index<'a>(conn: rocket_blog::DbConn) -> IndexTemplate<'a> { - IndexTemplate { title: "Bloggen", posts: models::get_posts(conn) } + IndexTemplate { title: "Bloggen", posts: models::Post::get_all(conn) } } #[get("/", format = "application/json")] fn index_json(conn: rocket_blog::DbConn) -> Json<Vec<models::Post>> { - Json(models::get_posts(conn)) + Json(models::Post::get_all(conn)) } fn main() { |