aboutsummaryrefslogtreecommitdiff
path: root/src/controller.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-07-27 15:22:26 +0200
committerMartin Fischer <martin@push-f.com>2022-07-27 15:23:28 +0200
commit2d9d1f7fa444204a9045f08e19af763f465af383 (patch)
treef29061a67ffc1ceb1b9b802bdd75f46942d302ab /src/controller.rs
parent98b0f80bdd1a0d5cebabf093651f66623a39cbd9 (diff)
refactor: remove needless borrows / returns
Diffstat (limited to 'src/controller.rs')
-rw-r--r--src/controller.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/controller.rs b/src/controller.rs
index ba1f2de..55ff4c2 100644
--- a/src/controller.rs
+++ b/src/controller.rs
@@ -200,7 +200,7 @@ impl MultiUserController {
}
fn list_shares(&self, repo: &Repository, branch: &Branch, username: &str, out: &mut String) {
- self.with_shares_cache(&repo, branch.clone(), |shares| {
+ self.with_shares_cache(repo, branch.clone(), |shares| {
out.push_str("<a href=..>../</a>");
let exact_shares: Vec<_> = shares
.exact_rules
@@ -326,7 +326,7 @@ impl Controller for MultiUserController {
))));
}
if path == "/" {
- return Err(multi_user_startpage(&self, parts, repo));
+ return Err(multi_user_startpage(self, parts, repo));
}
let mut iter = path.splitn(3, '/');
@@ -351,7 +351,7 @@ impl Controller for MultiUserController {
}
};
if unsanitized_path.is_empty() {
- let username = username_from_parts(&parts).unwrap();
+ let username = username_from_parts(parts).unwrap();
if username != rev.0 {
let mut page = Page::default();
self.list_shares(repo, &rev, username, &mut page.body);
@@ -380,7 +380,7 @@ impl Controller for MultiUserController {
context: &Context,
parts: &Parts,
) {
- let username = username_from_parts(&parts).unwrap();
+ let username = username_from_parts(parts).unwrap();
if context.branch.0 == username {
if context.path.components().count() == 0 {
match tree {
@@ -427,7 +427,7 @@ impl Controller for MultiUserController {
}
fn may_write_path(&self, ctx: &Context, parts: &Parts) -> bool {
- let username = username_from_parts(&parts).unwrap();
+ let username = username_from_parts(parts).unwrap();
if ctx.branch.0 == username {
return true;
}
@@ -442,7 +442,7 @@ impl Controller for MultiUserController {
}
fn may_move_path(&self, ctx: &Context, parts: &Parts) -> bool {
- ctx.branch.0 == username_from_parts(&parts).unwrap()
+ ctx.branch.0 == username_from_parts(parts).unwrap()
}
fn edit_hint_html(&self, ctx: &Context) -> Option<String> {
@@ -493,7 +493,7 @@ impl Controller for MultiUserController {
}
fn access_info_html(&self, ctx: &Context, parts: &Parts) -> Option<String> {
- let own_username = username_from_parts(&parts).unwrap();
+ let own_username = username_from_parts(parts).unwrap();
if own_username != ctx.branch.0 {
return None;
}