From: Greg Burri Date: Thu, 11 Mar 2021 10:36:15 +0000 (+0100) Subject: Remove all warnings X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=a6e2b764be26410d88083901d9333f885afa2b24;p=valheim_web.git Remove all warnings --- 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