Followed clippy recommendations
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user