aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 1f3f890..be38348 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -185,7 +185,7 @@ async fn serve<C: Controller + Send + Sync + 'static>(controller: C, args: Args)
async move {
Ok::<_, hyper::Error>(service_fn(move |req| {
- service(&origin, controller.clone(), req)
+ service(origin, controller.clone(), req)
}))
}
});
@@ -202,7 +202,7 @@ async fn service<C: Controller>(
let (mut parts, body) = request.into_parts();
let mut script_csp = "'none'".into();
- let mut frame_csp = "'none'".into();
+ let mut frame_csp = "'none'";
let mut resp = build_response(origin, &*controller, &mut parts, body)
.await
@@ -323,8 +323,7 @@ async fn build_response<C: Controller>(
let repo = Repository::open_bare(env::current_dir().unwrap()).unwrap();
- let (rev, unsanitized_path) = match controller.parse_url_path(&unsanitized_path, &parts, &repo)
- {
+ let (rev, unsanitized_path) = match controller.parse_url_path(&unsanitized_path, parts, &repo) {
Ok(parsed) => parsed,
Err(res) => return res,
};
@@ -368,7 +367,7 @@ async fn build_response<C: Controller>(
.map(|r| r.into_commit().unwrap().tree().unwrap());
if ctx.path.components().next().is_some() {
- let entr = match tree.and_then(|t| t.get_path(&ctx.path.as_ref())) {
+ let entr = match tree.and_then(|t| t.get_path(ctx.path.as_ref())) {
Ok(entr) => entr,
Err(_) => {
if unsanitized_path.ends_with('/') {
@@ -411,7 +410,7 @@ async fn build_response<C: Controller>(
.unwrap()
.into());
}
- return get_routes::get_blob(entr, params, controller, ctx, &parts);
+ return get_routes::get_blob(entr, params, controller, ctx, parts);
}
tree = ctx.repo.find_tree(entr.id());
@@ -420,7 +419,7 @@ async fn build_response<C: Controller>(
}
}
- get_routes::view_tree(tree, controller, &ctx, &parts)
+ get_routes::view_tree(tree, controller, &ctx, parts)
}
fn render_link(name: &str, label: &str, active_action: &str) -> String {