diff options
Diffstat (limited to 'src/http/render.rs')
| -rw-r--r-- | src/http/render.rs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/http/render.rs b/src/http/render.rs index 6e1083b..316988a 100644 --- a/src/http/render.rs +++ b/src/http/render.rs @@ -185,12 +185,7 @@ pub(crate) use panel::Panel; impl Panel { /// Built by the route handlers, which are in this module. pub(crate) fn new(title: &str, body: String) -> Self { - Self { - title: title.into(), - empty: body.trim().is_empty(), - empty_note: "no change".into(), - body, - } + Self { title: title.into(), empty: body.trim().is_empty(), empty_note: "no change".into(), body } } } @@ -419,21 +414,13 @@ pub(crate) fn static_asset(name: &str, accept_gzip: bool) -> crate::http::Res { "htmx.min.js" => { if accept_gzip { let gz: &[u8] = std::include_bytes!("../../static/htmx.min.js.gz"); - let mut r = Res::stream( - "text/javascript", - std::io::Cursor::new(gz.to_vec()), - Some(gz.len()), - ); + let mut r = Res::stream("text/javascript", std::io::Cursor::new(gz.to_vec()), Some(gz.len())); r.header("Content-Encoding", "gzip"); r.header("Cache-Control", "public, max-age=86400"); return r; } let raw: &[u8] = std::include_bytes!("../../static/htmx.min.js"); - let mut r = Res::stream( - "text/javascript", - std::io::Cursor::new(raw.to_vec()), - Some(raw.len()), - ); + let mut r = Res::stream("text/javascript", std::io::Cursor::new(raw.to_vec()), Some(raw.len())); r.header("Cache-Control", "public, max-age=86400"); r } |
