aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-07-08 19:56:46 +0200
committerMartin Fischer <martin@push-f.com>2021-07-18 17:11:50 +0200
commitb421830e6b8a55fb74cde0d1a8eeb27a12b90815 (patch)
tree7743f74665606d36f85653281eae8a2440e80b20
parent2a2af4b7b3450fa5cb092b06718ac59a9da9223e (diff)
refactor: remove unreachable else branch
When viewing the user directory of another user the request is intercepted beforehand by parse_url_path.
-rw-r--r--src/controller.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/controller.rs b/src/controller.rs
index 3e9fb29..e63ef97 100644
--- a/src/controller.rs
+++ b/src/controller.rs
@@ -381,8 +381,8 @@ impl Controller for MultiUserController {
parts: &Parts,
) {
let username = username_from_parts(&parts).unwrap();
- if context.path.components().count() == 0 {
- if context.branch.0 == username {
+ if context.branch.0 == username {
+ if context.path.components().count() == 0 {
match tree {
None => page.body.push_str(EMPTY_HOME_HINT),
Some(tree) => {
@@ -393,8 +393,6 @@ impl Controller for MultiUserController {
}
}
}
- } else {
- self.list_shares(&context.repo, &context.branch, username, &mut page.body);
}
}
}