From 7cdf928494e333ccbdaaaf12bb737436cfc216a5 Mon Sep 17 00:00:00 2001 From: rascul Date: Sun, 24 Jul 2022 07:45:54 -0500 Subject: [PATCH] remove extra deps and stuff --- src/main.rs | 2 +- src/routes/replay.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index dd119c7..74e525f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ mod routes; mod wot_log; use actix_files::Files; -use actix_web::{guard, middleware, web, App, HttpResponse, HttpServer}; +use actix_web::{middleware, web, App, HttpServer}; use handlebars::Handlebars; use log::info; diff --git a/src/routes/replay.rs b/src/routes/replay.rs index c701b14..c9f34bd 100644 --- a/src/routes/replay.rs +++ b/src/routes/replay.rs @@ -2,8 +2,7 @@ use std::fs::File; use std::io::{BufReader, Read}; use std::path::PathBuf; -use actix_web::http::header; -use actix_web::{get, HttpRequest, HttpResponse}; +use actix_web::{get, HttpResponse}; use actix_web::web::{Data, Path}; use handlebars::Handlebars; @@ -13,13 +12,11 @@ use serde_json::json; use crate::Result; #[get("/+{id}")] -pub async fn get(req: HttpRequest, id: Path, hb: Data>) -> Result { - println!("HIHIHI"); +pub async fn get(id: Path, hb: Data>) -> Result { let mut path = PathBuf::from("replays"); let id: String = id.into_inner(); path.push(&id); let file: File = File::open(&path)?; - info!("loaded file: {:?}", path); let mut buffer = BufReader::new(file); let mut file_contents = String::new(); buffer.read_to_string(&mut file_contents)?;