diff options
Diffstat (limited to 'src/get_routes.rs')
-rw-r--r-- | src/get_routes.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/get_routes.rs b/src/get_routes.rs index 3661896..b9ad933 100644 --- a/src/get_routes.rs +++ b/src/get_routes.rs @@ -56,8 +56,8 @@ fn view_blob<C: Controller>( ) -> Result<Response, Error> { let mut page = Page { title: ctx.file_name().unwrap().to_owned(), - body: String::new(), header: Some(action_links(¶ms.action, controller, &ctx, parts)), + ..Default::default() }; if let Some(access_info_html) = controller.access_info_html(&ctx, parts) { @@ -135,8 +135,8 @@ fn log_blob<C: Controller>( let mut page = Page { title: format!("Log for {}", filename), - body: String::new(), header: Some(action_links(¶ms.action, controller, &ctx, parts)), + ..Default::default() }; let mut walk = ctx.repo.revwalk()?; @@ -256,6 +256,7 @@ fn diff_blob<C: Controller>( title: format!("Commit for {}", ctx.file_name().unwrap()), body: "file removed".into(), header: Some(action_links(&action_param.action, controller, &ctx, parts)), + ..Default::default() } .into()); }; @@ -279,7 +280,7 @@ fn diff_blob<C: Controller>( ctx.file_name().unwrap() ), header: Some(action_links(&action_param.action, controller, &ctx, parts)), - body: String::new(), + ..Default::default() }; page.body.push_str("<div>"); if params.oldid.is_none() { @@ -400,6 +401,7 @@ fn remove_blob<C: Controller>( <label>Message <input name=msg autofocus></label>\ <button>Remove</button></form>" .into(), + ..Default::default() }; Ok(page.into()) @@ -413,8 +415,7 @@ pub fn view_tree<C: Controller>( ) -> Result<Response, Error> { let mut page = Page { title: ctx.path.to_string_lossy().to_string(), - body: String::new(), - header: None, + ..Default::default() }; page.body.push_str("<ul>"); |