diff options
Diffstat (limited to 'src/http/routes')
| -rw-r--r-- | src/http/routes/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/routes/mod.rs b/src/http/routes/mod.rs index 7495524..1ef7fde 100644 --- a/src/http/routes/mod.rs +++ b/src/http/routes/mod.rs @@ -33,7 +33,8 @@ pub(crate) fn login_form(state: &State, req: &Req) -> Res { page_to_res(Login { page, error: String::new() }, 200) } -pub fn logout(req: &Req) -> Res { +/// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. +pub(crate) fn logout(req: &Req) -> Res { if let Some(sid) = req.cookie("sid") { auth::drop_session(&sid); } @@ -62,7 +63,8 @@ pub fn login(state: &State, req: &Req) -> Res { } } -pub fn route(state: &State, req: &Req, seg: &[&str]) -> Res { +/// `pub(crate)`, not `pub`: the census counted it as test-only because the word appears in `tests/http.rs`, but only inside a string — a route path, a content type, the word "redirect" in an assertion message. Nothing in the test tier calls it. +pub(crate) fn route(state: &State, req: &Req, seg: &[&str]) -> Res { match (req.method.as_str(), seg) { ("GET", []) => dashboard(state, req), ("GET", ["reviews"]) => reviews(state, req), |
