fix dep bugs

This commit is contained in:
ajuvercr 2020-06-14 22:20:08 +02:00
parent 129c904967
commit cedcc09f0a
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "backend" name = "planetwars"
version = "0.1.1" version = "0.1.2"
authors = ["ajuvercr <arthur.vercruysse@ugent.be>"] authors = ["ajuvercr <arthur.vercruysse@ugent.be>"]
edition = "2018" edition = "2018"

View file

@ -47,7 +47,7 @@ use std::collections::HashMap;
/// Calculate viewbox from array of points (used in map preview), added to Tera engine. /// Calculate viewbox from array of points (used in map preview), added to Tera engine.
/// So this function can be called in template. /// So this function can be called in template.
fn calc_viewbox(value: Value, _: HashMap<String, Value>) -> tera::Result<Value> { fn calc_viewbox(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
let mut min_x = std::f64::MAX; let mut min_x = std::f64::MAX;
let mut min_y = std::f64::MAX; let mut min_y = std::f64::MAX;
let mut max_x = std::f64::MIN; let mut max_x = std::f64::MIN;
@ -79,7 +79,7 @@ fn calc_viewbox(value: Value, _: HashMap<String, Value>) -> tera::Result<Value>
} }
/// Get's the right colour for planets /// Get's the right colour for planets
fn get_colour(value: Value, _: HashMap<String, Value>) -> tera::Result<Value> { fn get_colour(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
return Ok(Value::String( return Ok(Value::String(
COLOURS[value.as_u64().unwrap_or(0) as usize].to_string(), COLOURS[value.as_u64().unwrap_or(0) as usize].to_string(),
)); ));