Remove itertools dependency

Collecting into Vec of &str and joining may even be faster according
to benchmarks:
https://gist.github.com/green-s/fbd0d374b290781ac9b3f8ff03e3245d
This commit is contained in:
link2xt
2021-11-20 10:01:14 +00:00
committed by Floris Bruynooghe
parent 8732b7a55c
commit c4d1a639b0
12 changed files with 37 additions and 31 deletions

View File

@@ -12,7 +12,6 @@ use crate::sync::SyncData::{AddQrToken, DeleteQrToken};
use crate::token::Namespace;
use crate::{chat, stock_str, token};
use anyhow::Result;
use itertools::Itertools;
use lettre_email::mime::{self};
use lettre_email::PartBuilder;
use serde::{Deserialize, Serialize};
@@ -177,7 +176,10 @@ impl Context {
} else {
Ok(Some((
format!("{{\"items\":[\n{}\n]}}", serialized),
ids.iter().map(|x| x.to_string()).join(","),
ids.iter()
.map(|x| x.to_string())
.collect::<Vec<String>>()
.join(","),
)))
}
}