From 5f1aa344abec37371bfc8fa912d1c2d57e29e1c2 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 4 Jul 2022 14:44:34 +0300 Subject: [PATCH] Fix unnecessary format lints. --- benches/benchs.rs | 3 +-- src/token/mod.rs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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);