Followed clippy recommendations

This commit is contained in:
2025-10-24 12:13:36 +02:00
parent d50a6a3d76
commit b1cb7dff27

View File

@@ -8,8 +8,8 @@ use std::path::PathBuf;
#[get("/static/{file_type}/{file_name}")] #[get("/static/{file_type}/{file_name}")]
async fn file(file: Path<(String, String)>, data: web::Data<AppState>) -> impl Responder { async fn file(file: Path<(String, String)>, data: web::Data<AppState>) -> impl Responder {
let mut path = PathBuf::from(&data.assets); let mut path = PathBuf::from(&data.assets);
path.push(&file.0.replace("/", "")); path.push(file.0.replace("/", ""));
path.push(&file.1.replace("/", "")); path.push(file.1.replace("/", ""));
let mut file = File::open(path).unwrap(); let mut file = File::open(path).unwrap();
let mut bytes = Vec::new(); let mut bytes = Vec::new();
if file.read_to_end(&mut bytes).is_err() { if file.read_to_end(&mut bytes).is_err() {