about summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-03-06 17:14:10 +0300
committerVika <vika@fireburn.ru>2022-03-06 17:14:10 +0300
commit998ffd3e3ac85a38aec8fc15c7addd02fa1af9ae (patch)
tree863e7daabf52edc8448fba45fc0b3e6acdba2b0a /src/lib.rs
parent11a39e85f2673029c7e317c02ae56bd8813773ad (diff)
downloadkittybox-998ffd3e3ac85a38aec8fc15c7addd02fa1af9ae.tar.zst
Restored most of the functionality (except onboarding and some queries)
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 93e4593..ffef443 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,23 +1,20 @@
-#[allow(unused_imports)]
-use warp::Filter;
+#![deny(unsafe_code)]
+#![warn(clippy::todo)]
 
 pub mod metrics;
 /// Database abstraction layer for Kittybox, allowing the CMS to work with any kind of database.
 pub mod database;
 pub mod micropub;
 pub mod indieauth;
-//pub mod frontend;
+pub mod frontend;
 
-/*use crate::indieauth::IndieAuthMiddleware;
-use crate::micropub::CORSMiddleware;*/
-
-pub mod rejections {
+pub(crate) mod rejections {
     #[derive(Debug)]
-    pub struct UnacceptableContentType;
+    pub(crate) struct UnacceptableContentType;
     impl warp::reject::Reject for UnacceptableContentType {}
 
     #[derive(Debug)]
-    pub struct HostHeaderUnset;
+    pub(crate) struct HostHeaderUnset;
     impl warp::reject::Reject for HostHeaderUnset {}
 }
 
@@ -49,6 +46,7 @@ pub mod util {
                 // This is unneccesarily complicated because I want to reuse some http-types parsing
                 // and http-types has constructor for Headers private so I need to construct
                 // a mock Request to reason about headers... this is so dumb wtf
+                // so much for zero-cost abstractions, huh
                 let bytes: &[u8] = accept.as_bytes();
                 let value = http_types::headers::HeaderValue::from_bytes(bytes.to_vec()).unwrap();
                 let values: http_types::headers::HeaderValues = vec![value].into();