diff --git a/src/handlers/error.rs b/src/handlers/error.rs index 0aaa543..94860f2 100644 --- a/src/handlers/error.rs +++ b/src/handlers/error.rs @@ -5,7 +5,10 @@ use axum::{ use crate::handlers; -pub fn by_code(code: Option, message: Option<&str>) -> Response { +pub(in crate::handlers) fn by_code( + code: Option, + message: Option<&str>, +) -> Response { let out_code = code.unwrap_or(500); let out_message = &message.unwrap_or("Unknown error"); diff --git a/src/handlers/raw.rs b/src/handlers/raw.rs index 13a8ccb..63333b4 100644 --- a/src/handlers/raw.rs +++ b/src/handlers/raw.rs @@ -3,7 +3,7 @@ use axum::{ http::{header, HeaderValue, Response, StatusCode}, }; -pub fn make_response( +pub(in crate::handlers) fn make_response( body: &str, status_code: u16, headers: &[(header::HeaderName, &str)], diff --git a/src/handlers/template.rs b/src/handlers/template.rs index b511e27..e819dc7 100644 --- a/src/handlers/template.rs +++ b/src/handlers/template.rs @@ -5,7 +5,7 @@ use axum::{ use crate::handlers::raw::make_response; -pub(super) fn by_filename( +pub(in crate::handlers) fn by_filename( name: &str, context: &tera::Context, error_code: u16, @@ -24,7 +24,7 @@ pub async fn fixed(name: &str) -> Response { by_filename(name, &tera::Context::new(), 500, None, false) } -pub(super) fn render( +pub(in crate::handlers) fn render( name: &str, // TODO take Option, skip context if None, // then template_handler can replace static_template_handler