From 2e1c30f0d45f205748ab6441b3971f5194c903ea Mon Sep 17 00:00:00 2001 From: Moritz Gunz Date: Sat, 4 Jan 2020 13:14:13 +0100 Subject: [PATCH] Fix docs --- src/client/mod.rs | 11 +++++++---- src/integrations/serde_integration.rs | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index d6a8a5d..e1d7af3 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -163,11 +163,14 @@ impl Client { /// ```rust /// use influxdb::{Client, Query, Timestamp}; /// + /// # #[tokio::main] + /// # async fn main() -> Result<(), Box> { /// let client = Client::new("http://localhost:8086", "test"); - /// let _future = client.query( - /// &Query::write_query(Timestamp::Now, "weather") - /// .add_field("temperature", 82) - /// ); + /// let query = Query::write_query(Timestamp::Now, "weather") + /// .add_field("temperature", 82); + /// let results = client.query(query).await?; + /// # Ok(()) + /// #} /// ``` /// # Errors /// diff --git a/src/integrations/serde_integration.rs b/src/integrations/serde_integration.rs index 374e173..0f89951 100644 --- a/src/integrations/serde_integration.rs +++ b/src/integrations/serde_integration.rs @@ -23,7 +23,7 @@ //! } //! //! # #[tokio::main] -//! # async fn main() -> Box { +//! # async fn main() -> Result<(), Box> { //! let client = Client::new("http://localhost:8086", "test"); //! let query = Query::raw_read_query( //! "SELECT temperature FROM /weather_[a-z]*$/ WHERE time > now() - 1m ORDER BY DESC", @@ -42,6 +42,7 @@ //! } //! }) //! .collect::>(); +//! # Ok(()) //! # } //! ```