Skip to content

Commit 26c0ba7

Browse files
authored
Replace futures dependency with futures-util (#102)
* Replace futures dependency with futures-util * trigger ci * fix
1 parent 988d354 commit 26c0ba7

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ influxdb = { version = "0.4.0", features = ["derive"] }
5858
For an example with using Serde deserialization, please refer to [serde_integration](crate::integrations::serde_integration)
5959

6060
```rust
61-
use influxdb::{Client, Query, Timestamp};
61+
use influxdb::{Client, Query, Timestamp, ReadQuery};
6262
use influxdb::InfluxDbWriteable;
6363
use chrono::{DateTime, Utc};
6464

@@ -88,7 +88,7 @@ async fn main() {
8888
assert!(write_result.is_ok(), "Write result was not okay");
8989

9090
// Let's see if the data we wrote is there
91-
let read_query = Query::raw_read_query("SELECT * FROM weather");
91+
let read_query = ReadQuery::new("SELECT * FROM weather");
9292

9393
let read_result = client.query(read_query).await;
9494
assert!(read_result.is_ok(), "Read result was not ok");

influxdb/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository = "https://github.com/influxdb-rs/influxdb-rust"
1414

1515
[dependencies]
1616
chrono = { version = "0.4.11", features = ["serde"] }
17-
futures = "0.3.4"
17+
futures-util = "0.3.17"
1818
http = "0.2.4"
1919
influxdb_derive = { version = "0.4.0", optional = true }
2020
lazy_static = "1.4.0"

influxdb/src/client/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! assert_eq!(client.database_name(), "test");
1616
//! ```
1717
18-
use futures::prelude::*;
18+
use futures_util::TryFutureExt;
1919
use http::StatusCode;
2020
#[cfg(feature = "reqwest")]
2121
use reqwest::{Client as HttpClient, Response as HttpResponse};

influxdb/src/integrations/serde_integration/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//! `name`, InfluxDB provides alongside query results.
88
//!
99
//! ```rust,no_run
10-
//! use futures::prelude::*;
1110
//! use influxdb::{Client, Query};
1211
//! use serde::Deserialize;
1312
//!

influxdb/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//! For an example with using Serde deserialization, please refer to [serde_integration](crate::integrations::serde_integration)
2727
//!
2828
//! ```rust,no_run
29-
//! use influxdb::{Client, Query, Timestamp};
29+
//! use influxdb::{Client, Query, Timestamp, ReadQuery};
3030
//! use influxdb::InfluxDbWriteable;
3131
//! use chrono::{DateTime, Utc};
3232
//!
@@ -56,7 +56,7 @@
5656
//! assert!(write_result.is_ok(), "Write result was not okay");
5757
//!
5858
//! // Let's see if the data we wrote is there
59-
//! let read_query = Query::raw_read_query("SELECT * FROM weather");
59+
//! let read_query = ReadQuery::new("SELECT * FROM weather");
6060
//!
6161
//! let read_result = client.query(read_query).await;
6262
//! assert!(read_result.is_ok(), "Read result was not ok");

influxdb/src/query/write_query.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ impl Query for WriteQuery {
196196
.join(",");
197197

198198
Ok(ValidQuery(format!(
199-
"{measurement}{tags} {fields}{time}",
199+
"{measurement}{tags} {fields} {time}",
200200
measurement = LineProtoTerm::Measurement(&self.measurement).escape(),
201201
tags = tags,
202202
fields = fields,
203-
time = format!(" {}", self.timestamp)
203+
time = self.timestamp
204204
)))
205205
}
206206

influxdb/tests/utilities.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use futures::prelude::*;
1+
use futures_util::FutureExt;
22
use influxdb::{Client, Error, ReadQuery};
3+
use std::future::Future;
34
use std::panic::{AssertUnwindSafe, UnwindSafe};
45

56
#[allow(dead_code)]

0 commit comments

Comments
 (0)