chore: remove all compiler and clippy warnings

This commit is contained in:
Jef Roosens 2025-04-05 09:20:41 +02:00
parent f3ede6f9a6
commit 279983c64c
Signed by: Jef Roosens
GPG key ID: 02D4C0997E74717B
9 changed files with 19 additions and 14 deletions

View file

@ -20,7 +20,7 @@ use crate::server::{
pub fn router() -> Router<Context> {
Router::new()
.route("/{username}/login.json", post(post_login))
.route("/{username}/logout.json", post(post_logout))
.route("/{_username}/logout.json", post(post_logout))
}
async fn post_login(
@ -85,7 +85,7 @@ async fn post_login(
async fn post_logout(
State(ctx): State<Context>,
Path(username): Path<String>,
Path(_username): Path<String>,
jar: CookieJar,
) -> AppResult<CookieJar> {
if let Some(session_id) = jar.get(SESSION_ID_COOKIE) {

View file

@ -19,7 +19,10 @@ pub fn router(ctx: Context) -> Router<Context> {
Router::new()
.route("/{username}", get(get_devices))
.route("/{username}/{id}", post(post_device))
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
.layer(middleware::from_fn_with_state(
ctx.clone(),
auth_api_middleware,
))
}
async fn get_devices(

View file

@ -22,7 +22,10 @@ pub fn router(ctx: Context) -> Router<Context> {
"/{username}/{id}",
post(post_subscription_changes).get(get_subscription_changes),
)
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
.layer(middleware::from_fn_with_state(
ctx.clone(),
auth_api_middleware,
))
}
pub async fn post_subscription_changes(

View file

@ -21,7 +21,10 @@ pub fn router(ctx: Context) -> Router<Context> {
"/{username}",
get(get_sync_status).post(post_sync_status_changes),
)
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
.layer(middleware::from_fn_with_state(
ctx.clone(),
auth_api_middleware,
))
}
pub async fn get_sync_status(

View file

@ -34,7 +34,7 @@ impl<'de> Deserialize<'de> for StringWithFormat {
{
struct StrVisitor;
impl<'de> Visitor<'de> for StrVisitor {
impl Visitor<'_> for StrVisitor {
type Value = StringWithFormat;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

View file

@ -18,7 +18,10 @@ pub fn router(ctx: Context) -> Router<Context> {
get(get_device_subscriptions).put(put_device_subscriptions),
)
.route("/{username}", get(get_user_subscriptions))
.layer(middleware::from_fn_with_state(ctx.clone(), auth_api_middleware))
.layer(middleware::from_fn_with_state(
ctx.clone(),
auth_api_middleware,
))
}
pub async fn get_device_subscriptions(