summaryrefslogtreecommitdiff
path: root/src/blog/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/blog/mod.rs')
-rw-r--r--src/blog/mod.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/blog/mod.rs b/src/blog/mod.rs
index c227f22..811de15 100644
--- a/src/blog/mod.rs
+++ b/src/blog/mod.rs
@@ -1,21 +1,20 @@
pub mod post;
pub mod handlers {
-use std::sync::Arc;
-use color_eyre::eyre::eyre;
+ use color_eyre::eyre::eyre;
+ use std::sync::Arc;
-use warp::{Reply, Rejection};
-use warp::http::Response;
-use crate::templates::{self, Html, RenderRucte};
+ use crate::templates::{self, Html, RenderRucte};
+ use warp::http::Response;
+ use warp::{Rejection, Reply};
-use crate::internal::SiteState;
+ use crate::internal::SiteState;
-use super::post::Post;
+ use super::post::Post;
pub async fn list(state: Arc<SiteState>) -> Result<impl Reply, Rejection> {
let state = state.clone();
- Response::builder()
- .html(|o| templates::bloglist_html(o, state.blog.clone()))
+ Response::builder().html(|o| templates::bloglist_html(o, state.blog.clone()))
}
pub async fn post(name: String, state: Arc<SiteState>) -> Result<impl Reply, Rejection> {
@@ -31,9 +30,8 @@ use super::post::Post;
match want {
Some(post) => {
let body = Html(post.body_html.clone());
- Response::builder()
- .html(|o| templates::post_html(o, post, body))
- },
+ Response::builder().html(|o| templates::post_html(o, post, body))
+ }
None => panic!("No post found"),
}
}