From a6e2b764be26410d88083901d9333f885afa2b24 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Thu, 11 Mar 2021 11:36:15 +0100 Subject: [PATCH] Remove all warnings --- backend/build.rs | 2 +- backend/src/main.rs | 17 ++--------------- backend/src/valheim_controller.rs | 6 ++---- common/src/lib.rs | 5 +++-- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/backend/build.rs b/backend/build.rs index 0d6baba..63a6105 100644 --- a/backend/build.rs +++ b/backend/build.rs @@ -28,7 +28,7 @@ fn main() { // Create static directory if it doesn't exist. if !Path::new("static").exists() { - std::fs::create_dir("static"); + std::fs::create_dir("static").unwrap(); } let output = diff --git a/backend/src/main.rs b/backend/src/main.rs index f14592e..b386358 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -5,7 +5,7 @@ extern crate askama; // use futures::sink::With; use listenfd::ListenFd; use actix_files as fs; -use actix_web::{ get, Responder, middleware, App, HttpServer, web::Query }; +use actix_web::{ get, Responder, middleware, App, HttpServer }; use askama::Template; use std::{ /*sync::Mutex, */fs::File, env::args, io::prelude::* }; @@ -26,15 +26,10 @@ struct MainTemplate { world_size: String } -#[derive(Deserialize)] -pub struct Request { - m: Option -} - const VALUE_UNKNOWN: &str = "-"; #[get("/")] -async fn main_page(/*key_shared: web::Data>,*/ query: Query) -> impl Responder { +async fn main_page() -> impl Responder { //let key = key_shared.lock().unwrap(); match valheim_controller::get_valheim_executable_information() { @@ -51,14 +46,6 @@ async fn main_page(/*key_shared: web::Data>,*/ query: Query String { for i in 0 .. 8 { let mut size: u64 = 1; - for j in 0 .. i { - size *= 1024; - } + size *= 1024u64.pow(i as u32); if bytes < 1024 { return format!("{} {}", std::cmp::max(0u64, bytes), BINARY_PREFIXES[i]); diff --git a/common/src/lib.rs b/common/src/lib.rs index 5112279..3d80a04 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,4 +1,4 @@ - +/* fn f(a: i32, b: i32) -> i32 { a + 2 * b } @@ -10,4 +10,5 @@ mod tests { fn it_works() { assert_eq!(2 + 2, 4); } -} \ No newline at end of file +} +*/ \ No newline at end of file -- 2.45.2