Skip to content

Commit fa4fb47

Browse files
mvucenovicEmpty2k12
authored andcommitted
Remove usage of itertools (#15)
Itertools crate was used for ergonomic join on the iterator of strings. Changed this to use join on the vec of strings from the std lib, and droped a dependecy of the crate. Std lib join should even be more performant, since it prealocates the string length correctly, while itertools is doing the best effort it can.
1 parent 871ba4f commit fa4fb47

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

Diff for: Cargo.lock

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ coveralls = { repository = "Empty2k12/influxdb-rust", branch = "master", service
1818
reqwest = "0.9.17"
1919
futures = "0.1.27"
2020
tokio = "0.1.20"
21-
itertools = "0.8"
2221
failure = "0.1.5"
2322
serde = { version = "1.0.92", optional = true }
2423
serde_json = { version = "1.0", optional = true }

Diff for: src/query/write_query.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
use crate::error::InfluxDbError;
66
use crate::query::{InfluxDbQuery, QueryType, Timestamp, ValidQuery};
7-
use itertools::Itertools;
87

98
// todo: batch write queries
109

@@ -142,6 +141,7 @@ impl InfluxDbQuery for InfluxDbWriteQuery {
142141
.tags
143142
.iter()
144143
.map(|(tag, value)| format!("{tag}={value}", tag = tag, value = value))
144+
.collect::<Vec<String>>()
145145
.join(",");
146146
if !tags.is_empty() {
147147
tags.insert_str(0, ",");
@@ -150,6 +150,7 @@ impl InfluxDbQuery for InfluxDbWriteQuery {
150150
.fields
151151
.iter()
152152
.map(|(field, value)| format!("{field}={value}", field = field, value = value))
153+
.collect::<Vec<String>>()
153154
.join(",");
154155

155156
Ok(ValidQuery(format!(

0 commit comments

Comments
 (0)