From 13fb9673298c11247abd54ee0e8c6d00da18dfe1 Mon Sep 17 00:00:00 2001 From: Jared Wolff Date: Sat, 8 Aug 2020 21:47:35 -0400 Subject: [PATCH 1/3] Implemeting clone and debug for WriteQuery an ReadQuery. --- influxdb/src/query/read_query.rs | 1 + influxdb/src/query/write_query.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/influxdb/src/query/read_query.rs b/influxdb/src/query/read_query.rs index 7ee0b43..44ec57f 100644 --- a/influxdb/src/query/read_query.rs +++ b/influxdb/src/query/read_query.rs @@ -5,6 +5,7 @@ use crate::query::{QueryType, ValidQuery}; use crate::{Error, Query}; +#[derive(Debug, Clone)] pub struct ReadQuery { queries: Vec, } diff --git a/influxdb/src/query/write_query.rs b/influxdb/src/query/write_query.rs index b66c747..2483c03 100644 --- a/influxdb/src/query/write_query.rs +++ b/influxdb/src/query/write_query.rs @@ -27,6 +27,7 @@ impl> WriteType for Option { } /// Internal Representation of a Write query that has not yet been built +#[derive(Debug, Clone)] pub struct WriteQuery { fields: Vec<(String, Type)>, tags: Vec<(String, Type)>, @@ -105,6 +106,7 @@ impl WriteQuery { } } +#[derive(Debug, Clone)] pub enum Type { Boolean(bool), Float(f64), From 486b443f74d536ec3027899c5c86606eda515701 Mon Sep 17 00:00:00 2001 From: Gero Gerke Date: Fri, 21 Aug 2020 22:33:34 +0200 Subject: [PATCH 2/3] Fix clippy errors --- influxdb/src/error.rs | 1 - influxdb/src/integrations/serde_integration.rs | 3 +-- influxdb/tests/integration_tests.rs | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/influxdb/src/error.rs b/influxdb/src/error.rs index 2f23b36..6a452d5 100644 --- a/influxdb/src/error.rs +++ b/influxdb/src/error.rs @@ -1,5 +1,4 @@ //! Errors that might happen in the crate -use reqwest; #[derive(Debug, Fail)] pub enum Error { diff --git a/influxdb/src/integrations/serde_integration.rs b/influxdb/src/integrations/serde_integration.rs index 1c941a1..e01b60a 100644 --- a/influxdb/src/integrations/serde_integration.rs +++ b/influxdb/src/integrations/serde_integration.rs @@ -49,7 +49,6 @@ use reqwest::{Client as ReqwestClient, StatusCode, Url}; use serde::{de::DeserializeOwned, Deserialize}; -use serde_json; use crate::{Client, Error, Query, ReadQuery}; @@ -110,7 +109,7 @@ impl Client { return Err(error); } }; - url.query_pairs_mut().append_pair("q", &read_query.clone()); + url.query_pairs_mut().append_pair("q", &read_query); if !read_query.contains("SELECT") && !read_query.contains("SHOW") { let error = Error::InvalidQueryError { diff --git a/influxdb/tests/integration_tests.rs b/influxdb/tests/integration_tests.rs index d69447e..20c0c8d 100644 --- a/influxdb/tests/integration_tests.rs +++ b/influxdb/tests/integration_tests.rs @@ -8,7 +8,6 @@ use utilities::{ use influxdb::InfluxDbWriteable; use influxdb::{Client, Error, Query, Timestamp}; -use tokio; /// INTEGRATION TEST /// From cb75b81e88e8b51e7cfba11e33ca8c9342a69755 Mon Sep 17 00:00:00 2001 From: Gero Gerke Date: Fri, 21 Aug 2020 23:39:02 +0200 Subject: [PATCH 3/3] run ci on PR --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c8dbaa9..f3e406a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,6 +1,6 @@ name: Rust -on: [push] +on: [push, pull_request] jobs: style: