Skip to content

Commit 2e1c30f

Browse files
committed
Fix docs
1 parent c23f7e5 commit 2e1c30f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/client/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,14 @@ impl Client {
163163
/// ```rust
164164
/// use influxdb::{Client, Query, Timestamp};
165165
///
166+
/// # #[tokio::main]
167+
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
166168
/// let client = Client::new("http://localhost:8086", "test");
167-
/// let _future = client.query(
168-
/// &Query::write_query(Timestamp::Now, "weather")
169-
/// .add_field("temperature", 82)
170-
/// );
169+
/// let query = Query::write_query(Timestamp::Now, "weather")
170+
/// .add_field("temperature", 82);
171+
/// let results = client.query(query).await?;
172+
/// # Ok(())
173+
/// #}
171174
/// ```
172175
/// # Errors
173176
///

src/integrations/serde_integration.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! }
2424
//!
2525
//! # #[tokio::main]
26-
//! # async fn main() -> Box<dyn std::error::Error> {
26+
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
2727
//! let client = Client::new("http://localhost:8086", "test");
2828
//! let query = Query::raw_read_query(
2929
//! "SELECT temperature FROM /weather_[a-z]*$/ WHERE time > now() - 1m ORDER BY DESC",
@@ -42,6 +42,7 @@
4242
//! }
4343
//! })
4444
//! .collect::<Vec<Weather>>();
45+
//! # Ok(())
4546
//! # }
4647
//! ```
4748

0 commit comments

Comments
 (0)