File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ impl Client {
7777 ///
7878 /// let _client = Client::new("http://localhost:8086", "test");
7979 /// ```
80+ #[ must_use = "Creating a client is pointless unless you use it" ]
8081 pub fn new < S1 , S2 > ( url : S1 , database : S2 ) -> Self
8182 where
8283 S1 : Into < String > ,
@@ -105,6 +106,7 @@ impl Client {
105106 ///
106107 /// let _client = Client::new("http://localhost:9086", "test").with_auth("admin", "password");
107108 /// ```
109+ #[ must_use = "Creating a client is pointless unless you use it" ]
108110 pub fn with_auth < S1 , S2 > ( mut self , username : S1 , password : S2 ) -> Self
109111 where
110112 S1 : Into < String > ,
@@ -118,6 +120,7 @@ impl Client {
118120 }
119121
120122 /// Replaces the HTTP Client
123+ #[ must_use = "Creating a client is pointless unless you use it" ]
121124 pub fn with_http_client ( mut self , http_client : HttpClient ) -> Self {
122125 self . client = http_client;
123126 self
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ pub struct ReadQuery {
1212
1313impl ReadQuery {
1414 /// Creates a new [`ReadQuery`]
15+ #[ must_use = "Creating a query is pointless unless you execute it" ]
1516 pub fn new < S > ( query : S ) -> Self
1617 where
1718 S : Into < String > ,
@@ -22,6 +23,7 @@ impl ReadQuery {
2223 }
2324
2425 /// Adds a query to the [`ReadQuery`]
26+ #[ must_use = "Creating a query is pointless unless you execute it" ]
2527 pub fn add_query < S > ( mut self , query : S ) -> Self
2628 where
2729 S : Into < String > ,
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ pub struct WriteQuery {
3737
3838impl WriteQuery {
3939 /// Creates a new [`WriteQuery`](crate::query::write_query::WriteQuery)
40+ #[ must_use = "Creating a query is pointless unless you execute it" ]
4041 pub fn new < S > ( timestamp : Timestamp , measurement : S ) -> Self
4142 where
4243 S : Into < String > ,
@@ -59,6 +60,7 @@ impl WriteQuery {
5960 ///
6061 /// Timestamp::Nanoseconds(0).into_query("measurement").add_field("field1", 5).build();
6162 /// ```
63+ #[ must_use = "Creating a query is pointless unless you execute it" ]
6264 pub fn add_field < S , F > ( mut self , field : S , value : F ) -> Self
6365 where
6466 S : Into < String > ,
@@ -83,6 +85,7 @@ impl WriteQuery {
8385 /// .into_query("measurement")
8486 /// .add_tag("field1", 5); // calling `.build()` now would result in a `Err(Error::InvalidQueryError)`
8587 /// ```
88+ #[ must_use = "Creating a query is pointless unless you execute it" ]
8689 pub fn add_tag < S , I > ( mut self , tag : S , value : I ) -> Self
8790 where
8891 S : Into < String > ,
You can’t perform that action at this time.
0 commit comments