Followed clippy recommendations
This commit is contained in:
@@ -8,8 +8,8 @@ use std::path::PathBuf;
|
||||
#[get("/static/{file_type}/{file_name}")]
|
||||
async fn file(file: Path<(String, String)>, data: web::Data<AppState>) -> impl Responder {
|
||||
let mut path = PathBuf::from(&data.assets);
|
||||
path.push(&file.0.replace("/", ""));
|
||||
path.push(&file.1.replace("/", ""));
|
||||
path.push(file.0.replace("/", ""));
|
||||
path.push(file.1.replace("/", ""));
|
||||
let mut file = File::open(path).unwrap();
|
||||
let mut bytes = Vec::new();
|
||||
if file.read_to_end(&mut bytes).is_err() {
|
||||
|
||||
Reference in New Issue
Block a user