diff options
Diffstat (limited to 'src/controller.rs')
-rw-r--r-- | src/controller.rs | 20 |
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; } }); |