diff options
author | Martin Fischer <martin@push-f.com> | 2021-07-08 19:56:46 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-07-18 17:11:50 +0200 |
commit | b421830e6b8a55fb74cde0d1a8eeb27a12b90815 (patch) | |
tree | 7743f74665606d36f85653281eae8a2440e80b20 | |
parent | 2a2af4b7b3450fa5cb092b06718ac59a9da9223e (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.rs | 6 |
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); } } } |