diff options
author | Joris | 2023-04-17 21:10:48 +0200 |
---|---|---|
committer | Joris | 2023-04-17 21:10:48 +0200 |
commit | 459016e70dd4933a8082d27748097de81a3e53ff (patch) | |
tree | 0ed14ecc8762d62a55bf8c05356bcc984b1a0cea /src/templates.rs | |
parent | 3932daa26360d6e03807381d0b8ffa2d0e704847 (diff) |
Follow clippy indications
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 { |