Fix code quality: trailing whitespace, unused imports, clippy warnings
- Fix trailing whitespace in kex.rs and s3.rs - Add missing KexProposal import in kex_complete.rs - Auto-fix clippy warnings across all crates - All 153 tests pass
This commit is contained in:
@@ -1,27 +1,22 @@
|
||||
use axum::{
|
||||
extract::{Path, State},
|
||||
http::{HeaderMap, StatusCode},
|
||||
response::{Html, IntoResponse, Json},
|
||||
extract::Path,
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Json},
|
||||
};
|
||||
use serde_json::json;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::server::AppState;
|
||||
use crate::download::storage;
|
||||
|
||||
pub async fn list_uploaded_files(
|
||||
Path(user_id): Path<String>,
|
||||
) -> impl IntoResponse {
|
||||
pub async fn list_uploaded_files(Path(user_id): Path<String>) -> impl IntoResponse {
|
||||
let file_list = storage::scan_uploaded_files(&user_id);
|
||||
(StatusCode::OK, Json(file_list))
|
||||
}
|
||||
|
||||
pub async fn get_file_info(
|
||||
Path((user_id, filename)): Path<(String, String)>,
|
||||
) -> impl IntoResponse {
|
||||
pub async fn get_file_info(Path((user_id, filename)): Path<(String, String)>) -> impl IntoResponse {
|
||||
let base_path = format!("/Users/accusys/Downloads/{}", user_id);
|
||||
let file_path = PathBuf::from(&base_path).join(&filename);
|
||||
|
||||
|
||||
if !file_path.exists() {
|
||||
return (
|
||||
StatusCode::NOT_FOUND,
|
||||
@@ -29,7 +24,7 @@ pub async fn get_file_info(
|
||||
)
|
||||
.into_response();
|
||||
}
|
||||
|
||||
|
||||
let metadata = std::fs::metadata(&file_path).unwrap();
|
||||
let file_size = metadata.len();
|
||||
let file_hash = if file_size > 0 {
|
||||
@@ -37,7 +32,7 @@ pub async fn get_file_info(
|
||||
} else {
|
||||
Some("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855".to_string())
|
||||
};
|
||||
|
||||
|
||||
(
|
||||
StatusCode::OK,
|
||||
Json(json!({
|
||||
@@ -49,4 +44,4 @@ pub async fn get_file_info(
|
||||
})),
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user