chore: bump rust edition to 2024

This commit is contained in:
alyssa 2025-09-01 03:36:13 +00:00
parent 214f164fbc
commit ebb23286d8
41 changed files with 70 additions and 69 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "avatars"
version = "0.1.0"
edition = "2021"
edition = "2024"
[[bin]]
name = "avatar_cleanup"

View file

@ -8,10 +8,10 @@ use anyhow::Context;
use axum::extract::State;
use axum::routing::get;
use axum::{
Json, Router,
http::StatusCode,
response::{IntoResponse, Response},
routing::post,
Json, Router,
};
use libpk::_config::AvatarsConfig;
use libpk::db::repository::avatars as db;
@ -153,7 +153,7 @@ async fn verify(
)
.await?;
let encoded = process::process_async(result.data, req.kind).await?;
process::process_async(result.data, req.kind).await?;
Ok(())
}

View file

@ -4,7 +4,7 @@ use std::io::Cursor;
use std::time::Instant;
use tracing::{debug, error, info, instrument};
use crate::{hash::Hash, ImageKind, PKAvatarError};
use crate::{ImageKind, PKAvatarError, hash::Hash};
const MAX_DIMENSION: u32 = 4000;

View file

@ -62,7 +62,7 @@ pub async fn pull(
let size = match response.content_length() {
None => return Err(PKAvatarError::MissingHeader("Content-Length")),
Some(size) if size > MAX_SIZE => {
return Err(PKAvatarError::ImageFileSizeTooLarge(size, MAX_SIZE))
return Err(PKAvatarError::ImageFileSizeTooLarge(size, MAX_SIZE));
}
Some(size) => size,
};
@ -162,7 +162,7 @@ pub fn parse_url(url: &str) -> anyhow::Result<ParsedUrl> {
attachment_id: 0,
filename: "".to_string(),
full_url: url.to_string(),
})
});
}
_ => anyhow::bail!("not a discord cdn url"),
}