diff options
Diffstat (limited to 'src/templates.rs')
-rw-r--r-- | src/templates.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/templates.rs b/src/templates.rs index 390a3aa..c537ac7 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -57,7 +57,7 @@ fn euros(value: &Value, _: &HashMap<String, Value>) -> Result<Value> { let sign = if n < 0 { "-" } else { "" }; Ok(json!(format!("{}{} €", sign, str))) } else if let Some(n) = n.as_f64() { - Ok(json!(format!("{} €", n.to_string()))) + Ok(json!(format!("{} €", n))) } else { Err(Error::msg("Error parsing number")) } @@ -74,7 +74,7 @@ fn numeric(value: &Value, _: &HashMap<String, Value>) -> Result<Value> { let sign = if n < 0 { "-" } else { "" }; Ok(json!(format!("{}{}", sign, str))) } else if let Some(n) = n.as_f64() { - Ok(json!(format!("{}", n.to_string()))) + Ok(json!(format!("{}", n))) } else { Err(Error::msg("Error parsing number")) } @@ -84,7 +84,7 @@ fn numeric(value: &Value, _: &HashMap<String, Value>) -> Result<Value> { } fn rgrouped(str: String, n: usize) -> Vec<String> { - let mut str = str.clone(); + let mut str = str; let mut l = str.len(); let mut res = vec![]; while l > n { |