chore: clean up compile warnings

This commit is contained in:
alyssa 2025-01-02 02:37:15 +00:00
parent 16ce67e02c
commit 89d6481ddb
16 changed files with 37 additions and 32 deletions

View file

@ -1,6 +1,8 @@
use axum::http::StatusCode;
use std::fmt;
// todo
#[allow(dead_code)]
#[derive(Debug)]
pub struct PKError {
pub response_code: StatusCode,
@ -16,6 +18,7 @@ impl fmt::Display for PKError {
impl std::error::Error for PKError {}
#[allow(unused_macros)]
macro_rules! define_error {
( $name:ident, $response_code:expr, $json_code:expr, $message:expr ) => {
const $name: PKError = PKError {
@ -26,4 +29,4 @@ macro_rules! define_error {
};
}
define_error! { GENERIC_BAD_REQUEST, StatusCode::BAD_REQUEST, 0, "400: Bad Request" }
// define_error! { GENERIC_BAD_REQUEST, StatusCode::BAD_REQUEST, 0, "400: Bad Request" }

View file

@ -20,6 +20,7 @@ pub fn header_or_unknown(header: Option<&HeaderValue>) -> &str {
}
}
#[allow(dead_code)]
pub fn wrapper<F>(handler: F) -> impl Fn() -> axum::response::Response
where
F: Fn() -> anyhow::Result<Value>,