aboutsummaryrefslogtreecommitdiff
path: root/src/controller.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-10-28 14:03:05 +0200
committerMartin Fischer <martin@push-f.com>2022-10-28 14:03:05 +0200
commit95aa0534320a6b077a6063b612a099dd3d9d4145 (patch)
treecd6e0ab7de62bb8b53a2afed9a184f3adcb9e5f2 /src/controller.rs
parent6d2b42da54335682bf5ba25277323daafca16808 (diff)
refactor: some linter fixes
Diffstat (limited to 'src/controller.rs')
-rw-r--r--src/controller.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/controller.rs b/src/controller.rs
index 9127900..42520f4 100644
--- a/src/controller.rs
+++ b/src/controller.rs
@@ -395,16 +395,14 @@ impl Controller for MultiUserController {
parts: &Parts,
) {
let username = username_from_parts(parts).unwrap();
- if context.branch.0 == username {
- if context.path.components().count() == 0 {
- match tree {
- None => page.body.push_str(EMPTY_HOME_HINT),
- Some(tree) => {
- if tree.iter().count() == 0 {
- page.body.push_str(EMPTY_HOME_HINT);
- } else if tree.get_path(Path::new(".shares.txt")).is_err() {
- page.body.push_str("<p>Share files with other users by <a href='.shares.txt?action=edit'>creating a .shares.txt</a> config.</p>");
- }
+ if context.branch.0 == username && context.path.components().count() == 0 {
+ match tree {
+ None => page.body.push_str(EMPTY_HOME_HINT),
+ Some(tree) => {
+ if tree.iter().count() == 0 {
+ page.body.push_str(EMPTY_HOME_HINT);
+ } else if tree.get_path(Path::new(".shares.txt")).is_err() {
+ page.body.push_str("<p>Share files with other users by <a href='.shares.txt?action=edit'>creating a .shares.txt</a> config.</p>");
}
}
}
@@ -433,7 +431,7 @@ impl Controller for MultiUserController {
let mut ok = false;
self.with_shares_cache(&ctx.repo, ctx.branch.clone(), |shares| {
- if let Some(mode) = shares.find_mode(ctx.path.as_str(), username) {
+ if let Some(_mode) = shares.find_mode(ctx.path.as_str(), username) {
ok = true;
}
});