aboutsummaryrefslogtreecommitdiff
path: root/src/helper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper.rs')
-rw-r--r--src/helper.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/helper.rs b/src/helper.rs
new file mode 100644
index 0000000..22ccd0d
--- /dev/null
+++ b/src/helper.rs
@@ -0,0 +1,21 @@
+use axum::{
+ http::{HeaderValue, header},
+ response::{IntoResponse, Response},
+};
+
+#[derive(Clone, Copy, Debug)]
+#[must_use]
+pub struct Css<T>(pub T);
+
+impl<T> IntoResponse for Css<T>
+where
+ T: IntoResponse,
+{
+ fn into_response(self) -> Response {
+ (
+ [(header::CONTENT_TYPE, HeaderValue::from_static("text/css"))],
+ self.0,
+ )
+ .into_response()
+ }
+}