diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 9f20460..f81c602 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "backend" -version = "0.1.1" +name = "planetwars" +version = "0.1.2" authors = ["ajuvercr "] edition = "2018" diff --git a/backend/src/main.rs b/backend/src/main.rs index d4b2cc8..46d9999 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -47,7 +47,7 @@ use std::collections::HashMap; /// Calculate viewbox from array of points (used in map preview), added to Tera engine. /// So this function can be called in template. -fn calc_viewbox(value: Value, _: HashMap) -> tera::Result { +fn calc_viewbox(value: &Value, _: &HashMap) -> tera::Result { let mut min_x = std::f64::MAX; let mut min_y = std::f64::MAX; let mut max_x = std::f64::MIN; @@ -79,7 +79,7 @@ fn calc_viewbox(value: Value, _: HashMap) -> tera::Result } /// Get's the right colour for planets -fn get_colour(value: Value, _: HashMap) -> tera::Result { +fn get_colour(value: &Value, _: &HashMap) -> tera::Result { return Ok(Value::String( COLOURS[value.as_u64().unwrap_or(0) as usize].to_string(), ));