diff --git a/benches/benchs.rs b/benches/benchs.rs index 5812051..f573002 100644 --- a/benches/benchs.rs +++ b/benches/benchs.rs @@ -9,9 +9,8 @@ extern crate test; use evalexpr::build_operator_tree; use rand::{distributions::Uniform, seq::SliceRandom, Rng, SeedableRng}; use rand_pcg::Pcg32; -use std::hint::black_box; +use std::{fmt::Write, hint::black_box}; use test::Bencher; -use std::fmt::Write; const BENCHMARK_LEN: usize = 100_000; const EXPONENTIAL_TUPLE_ITERATIONS: usize = 12; diff --git a/src/token/mod.rs b/src/token/mod.rs index 0cde4e4..7b9d504 100644 --- a/src/token/mod.rs +++ b/src/token/mod.rs @@ -445,6 +445,7 @@ pub(crate) fn tokenize(string: &str) -> EvalexprResult> { #[cfg(test)] mod tests { use crate::token::{char_to_partial_token, tokenize}; + use std::fmt::Write; #[test] fn test_partial_token_display() { @@ -468,7 +469,7 @@ mod tests { let mut result_string = String::new(); for token in tokens { - result_string += &format!("{} ", token); + write!(result_string, "{} ", token).unwrap(); } assert_eq!(token_string, result_string);