summaryrefslogtreecommitdiffstats
path: root/src/http/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/mod.rs')
-rw-r--r--src/http/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs
index 5c34466..a77869e 100644
--- a/src/http/mod.rs
+++ b/src/http/mod.rs
@@ -48,7 +48,8 @@ pub(crate) struct Res {
}
impl Res {
- pub fn html(status: u16, body: String) -> Self {
+ /// `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 html(status: u16, body: String) -> Self {
Self { status, content_type: "text/html; charset=utf-8".into(), body: body.into_bytes(), headers: Vec::new(), stream: None, stream_len: None }
}
pub fn text(status: u16, body: String) -> Self {
@@ -64,7 +65,8 @@ impl Res {
stream_len: known_len,
}
}
- pub fn redirect(location: &str) -> Self {
+ /// `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 redirect(location: &str) -> Self {
Self {
status: 303,
content_type: "text/plain".into(),