From b4091c4f610e2637e025c01da74bfc1252b54c9c Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:00:10 +0100 Subject: [PATCH 01/18] CI: Use cargo 1.84 feature to check MSRV --- .github/workflows/rust.yml | 24 +++++++++++++++++++++--- Cargo.toml | 7 +++++++ README.j2 | 4 ++-- influxdb/Cargo.toml | 10 +++++----- influxdb_derive/Cargo.toml | 10 +++++----- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bc94844e..7e5a0e3f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -67,6 +67,9 @@ jobs: fail-fast: false matrix: rust: + - name: MSRV + toolchain: stable + nightly: false - name: Stable toolchain: stable nightly: false @@ -79,19 +82,34 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 + # on non-msrv runs, just download rust - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust.toolchain}} id: rust-toolchain + if: matrix.rust.name != 'MSRV' + # on msrv runs, use stable to generate Cargo.lock then downgrade + - uses: dtolnay/rust-toolchain@stable + if: matrix.rust.name == 'MSRV' + - run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update + - run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT + id: msrv + if: matrix.rust.name == 'MSRV' + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{steps.msrv.outputs.rust-version}} + id: rust-toolchain + if: matrix.rust.name == 'MSRV' + # the rest is independent of whether msrv is used - uses: actions/cache@v4 with: path: | ~/.cargo/git ~/.cargo/registry target - key: "${{matrix.rust.toolchain}} on ${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}" - - run: cargo test --lib - - run: cargo test --doc + key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}" + - run: cargo test --lib --locked + - run: cargo test --doc --locked # this tests that all integration tests are successful integration_tests: diff --git a/Cargo.toml b/Cargo.toml index d87619ef..b7a30bbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,13 @@ [workspace] members = ["influxdb", "influxdb_derive", "benches"] +[workspace.package] +authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] +edition = "2018" +rust-version = "1.65" +license = "MIT" +repository = "https://github.com/influxdb-rs/influxdb-rust" + [patch.crates-io] influxdb = { path = "./influxdb" } influxdb_derive = { path = "./influxdb_derive" } diff --git a/README.j2 b/README.j2 index be728ded..ead28b43 100644 --- a/README.j2 +++ b/README.j2 @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.67 + + Minimum Rust Version: 1.65

diff --git a/influxdb/Cargo.toml b/influxdb/Cargo.toml index c31729ac..f88f8417 100644 --- a/influxdb/Cargo.toml +++ b/influxdb/Cargo.toml @@ -3,15 +3,15 @@ [package] name = "influxdb" version = "0.7.2" -authors = ["Gero Gerke <11deutron11@gmail.com>"] -edition = "2018" +authors.workspace = true +edition.workspace = true +rust-version.workspace = true description = "InfluxDB Driver for Rust" keywords = ["influxdb", "database", "influx"] -license = "MIT" +license.workspace = true readme = "README.md" include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"] -repository = "https://github.com/influxdb-rs/influxdb-rust" -rust-version = "1.70" +repository.workspace = true [dependencies] chrono = { version = "0.4.23", features = ["serde"], default-features = false } diff --git a/influxdb_derive/Cargo.toml b/influxdb_derive/Cargo.toml index 6e4b3776..7c5df571 100644 --- a/influxdb_derive/Cargo.toml +++ b/influxdb_derive/Cargo.toml @@ -3,15 +3,15 @@ [package] name = "influxdb_derive" version = "0.5.1" -authors = ["Gero Gerke <11deutron11@gmail.com>"] -edition = "2018" +authors.workspace = true +edition.workspace = true +rust-version.workspace = true description = "Private implementation detail of the influxdb crate" keywords = ["influxdb", "database", "influx", "derive"] -license = "MIT" +license.workspace = true readme = "README.md" include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"] -repository = "https://github.com/influxdb-rs/influxdb-rust" -rust-version = "1.70" +repository.workspace = true [lib] proc-macro = true From 2aeccfa4cea64df3dd88b65863a037737c5e0965 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:03:40 +0100 Subject: [PATCH 02/18] github actions is stupid --- .github/workflows/rust.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7e5a0e3f..4f081a6e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -82,15 +82,11 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 - # on non-msrv runs, just download rust - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust.toolchain}} id: rust-toolchain - if: matrix.rust.name != 'MSRV' # on msrv runs, use stable to generate Cargo.lock then downgrade - - uses: dtolnay/rust-toolchain@stable - if: matrix.rust.name == 'MSRV' - run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update - run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT id: msrv @@ -98,9 +94,9 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{steps.msrv.outputs.rust-version}} - id: rust-toolchain + id: msrv-toolchain if: matrix.rust.name == 'MSRV' - # the rest is independent of whether msrv is used + # on non-msrv runs, use one cache key ... - uses: actions/cache@v4 with: path: | @@ -108,6 +104,15 @@ jobs: ~/.cargo/registry target key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}" + # ... and on msrv runs, use another + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/git + ~/.cargo/registry + target + key: "${{runner.os}} Rust ${{steps.msrv-toolchain.outputs.cachekey}}" + # finally we can run tests - run: cargo test --lib --locked - run: cargo test --doc --locked From 8dd3a76de14544c0882e8ea30a97c1878ce05802 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:04:12 +0100 Subject: [PATCH 03/18] kill the other msrv job --- .github/workflows/rust.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4f081a6e..5c61309e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,20 +44,6 @@ jobs: - name: Check code formatting run: cargo fmt --all -- --check - # this checks the msrv - msrv: - name: Verify MSRV - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: baptiste0928/cargo-install@v3 - with: - crate: cargo-msrv - - name: Verify minimum rust version of influxdb crate - run: cargo msrv --path influxdb --output-format json verify - - name: Verify minimum rust version of influxdb_derive crate - run: cargo msrv --path influxdb_derive --output-format json verify - # this tests that all unit and doc tests are successful unit_tests: name: Unit and Doc Tests (Rust ${{matrix.rust.name}} on ${{matrix.os}}) From 8489a1dbde7d713b59ea04d7b7bba6cf9a6b7d86 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:06:11 +0100 Subject: [PATCH 04/18] need to install yq --- .github/workflows/rust.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5c61309e..56eda931 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -72,8 +72,10 @@ jobs: with: toolchain: ${{matrix.rust.toolchain}} id: rust-toolchain - # on msrv runs, use stable to generate Cargo.lock then downgrade - run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update + # on msrv runs, downgrade rust after generating the Cargo.lock file + - run: apk -y update && apk -y install --no-install-recommends yq + if: matrix.rust.name == 'MSRV' - run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT id: msrv if: matrix.rust.name == 'MSRV' From 968a5565bf3122920c5af1f61064a180476db2f3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:06:27 +0100 Subject: [PATCH 05/18] debian typo's apk as apt --- .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 56eda931..1e910ef2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,7 +74,7 @@ jobs: id: rust-toolchain - run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update # on msrv runs, downgrade rust after generating the Cargo.lock file - - run: apk -y update && apk -y install --no-install-recommends yq + - run: apt -y update && apt -y install --no-install-recommends yq if: matrix.rust.name == 'MSRV' - run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT id: msrv From 61d62a239f01a417d50b477cf73b2755e2a28b65 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:07:48 +0100 Subject: [PATCH 06/18] apt needs sudo --- .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 1e910ef2..7b4de051 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,7 +74,7 @@ jobs: id: rust-toolchain - run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update # on msrv runs, downgrade rust after generating the Cargo.lock file - - run: apt -y update && apt -y install --no-install-recommends yq + - run: sudo apt -y update && sudo apt -y install --no-install-recommends yq if: matrix.rust.name == 'MSRV' - run: echo "rust-version=$(tomlq -r '.workspace.package."rust-version"' Cargo.toml)" >>$GITHUB_OUTPUT id: msrv From 3d6bd4a86c0e1f28808985370a78a13bd178b3a3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:09:11 +0100 Subject: [PATCH 07/18] add if to cache --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7b4de051..965a2449 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -92,6 +92,7 @@ jobs: ~/.cargo/registry target key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}" + if: matrix.rust.name != 'MSRV' # ... and on msrv runs, use another - uses: actions/cache@v4 with: @@ -100,6 +101,7 @@ jobs: ~/.cargo/registry target key: "${{runner.os}} Rust ${{steps.msrv-toolchain.outputs.cachekey}}" + if: matrix.rust.name == 'MSRV' # finally we can run tests - run: cargo test --lib --locked - run: cargo test --doc --locked From bf39d30d61bfa10131053b74970a70c6a71a8f39 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:11:25 +0100 Subject: [PATCH 08/18] fuck windows and mac os --- .github/workflows/rust.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 965a2449..bbb2a1f6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -53,9 +53,6 @@ jobs: fail-fast: false matrix: rust: - - name: MSRV - toolchain: stable - nightly: false - name: Stable toolchain: stable nightly: false @@ -66,6 +63,12 @@ jobs: toolchain: nightly nightly: true os: [ubuntu-latest, windows-latest, macOS-latest] + include: + - rust: + name: MSRV + toolchain: stable + nightly: false + os: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master From f5131937738243e85313de2dee75cac8b95c7967 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:16:30 +0100 Subject: [PATCH 09/18] Drop MSRV to 1.63 We could go lower but then we'd be at idna<1.0 and I believe that has some advisories ... --- Cargo.toml | 2 +- README.j2 | 4 +- README.md | 128 +++++++++++++++++++++++------------------------------ 3 files changed, 59 insertions(+), 75 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b7a30bbd..790d21b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] edition = "2018" -rust-version = "1.65" +rust-version = "1.63" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" diff --git a/README.j2 b/README.j2 index ead28b43..adbc59de 100644 --- a/README.j2 +++ b/README.j2 @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.65 + + Minimum Rust Version: 1.63

diff --git a/README.md b/README.md index 9865904d..330fc0cd 100644 --- a/README.md +++ b/README.md @@ -25,40 +25,36 @@ Build with Rust - - Minimum Rust Version: 1.65 + + Minimum Rust Version: 1.63

Pull requests are always welcome. See [Contributing][__link0] and [Code of Conduct][__link1]. For a list of past changes, see [CHANGELOG.md][__link2]. - ### Currently Supported Features - - Reading and writing to InfluxDB - - Optional Serde support for deserialization - - Running multiple queries in one request (e.g. `SELECT * FROM weather_berlin; SELECT * FROM weather_london`) - - Writing single or multiple measurements in one request (e.g. `WriteQuery` or `Vec` argument) - - Authenticated and unauthenticated connections - - `async`/`await` support - - `#[derive(InfluxDbWriteable)]` derive macro for writing / reading into structs - - `GROUP BY` support - - Tokio and async-std support (see example below) or [available backends][__link3] - - Swappable HTTP backends ([see below](#Choice-of-HTTP-backend)) - +* Reading and writing to InfluxDB +* Optional Serde support for deserialization +* Running multiple queries in one request (e.g. `SELECT * FROM weather_berlin; SELECT * FROM weather_london`) +* Writing single or multiple measurements in one request (e.g. `WriteQuery` or `Vec` argument) +* Authenticated and unauthenticated connections +* `async`/`await` support +* `#[derive(InfluxDbWriteable)]` derive macro for writing / reading into structs +* `GROUP BY` support +* Tokio and async-std support (see example below) or [available backends][__link3] +* Swappable HTTP backends ([see below](#Choice-of-HTTP-backend)) ## Quickstart Add the following to your `Cargo.toml` - ```toml influxdb = { version = "0.7.2", features = ["derive"] } ``` For an example with using Serde deserialization, please refer to [serde_integration][__link4] - ```rust use chrono::{DateTime, Utc}; use influxdb::{Client, Error, InfluxDbWriteable, ReadQuery, Timestamp}; @@ -104,73 +100,62 @@ async fn main() -> Result<(), Error> { } ``` -For further examples, check out the integration tests in `tests/integration_tests.rs` in the repository. - +For further examples, check out the integration tests in `tests/integration_tests.rs` +in the repository. ## Choice of HTTP backend To communicate with InfluxDB, you can choose the HTTP backend to be used configuring the appropriate feature. We recommend sticking with the default reqwest-based client, unless you really need async-std compatibility. - - **[hyper][__link5]** (through reqwest, used by default), with [rustls][__link6] - ```toml - influxdb = { version = "0.7.2", features = ["derive"] } - ``` - - - - **[hyper][__link7]** (through reqwest), with native TLS (OpenSSL) - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls"] } - ``` - - - - **[hyper][__link8]** (through reqwest), with vendored native TLS (OpenSSL) - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls-vendored"] } - ``` - - - - **[hyper][__link9]** (through surf), use this if you need tokio 0.2 compatibility - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "hyper-client"] } - ``` - - - - **[curl][__link10]**, using [libcurl][__link11] - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] } - ``` - - - - **[async-h1][__link12]** with native TLS (OpenSSL) - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] } - ``` - - - - **[async-h1][__link13]** with [rustls][__link14] - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] } - ``` - - - - WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link15]** - ```toml - influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] } - ``` - - - +* **[hyper][__link5]** (through reqwest, used by default), with [rustls][__link6] + ```toml + influxdb = { version = "0.7.2", features = ["derive"] } + ``` + +* **[hyper][__link7]** (through reqwest), with native TLS (OpenSSL) + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls"] } + ``` + +* **[hyper][__link8]** (through reqwest), with vendored native TLS (OpenSSL) + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "reqwest-client-native-tls-vendored"] } + ``` + +* **[hyper][__link9]** (through surf), use this if you need tokio 0.2 compatibility + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "hyper-client"] } + ``` + +* **[curl][__link10]**, using [libcurl][__link11] + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "curl-client"] } + ``` + +* **[async-h1][__link12]** with native TLS (OpenSSL) + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client"] } + ``` + +* **[async-h1][__link13]** with [rustls][__link14] + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "h1-client-rustls"] } + ``` + +* WebAssembly’s `window.fetch`, via `web-sys` and **[wasm-bindgen][__link15]** + ```toml + influxdb = { version = "0.7.2", default-features = false, features = ["derive", "serde", "wasm-client"] } + ``` ## License -[![License: MIT][__link16]][__link17] - +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)][__link16] @ 2020-2024 Gero Gerke, msrd0 and [contributors]. [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG_RDmlyxxvyrG0rwcLBKoYdvG5It9hbWNgjUGzjD8iBYfsFFYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg + [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGyIMJPLf2ROkG1r7sBs89LDFG3LXR7q-ZFu2GzrbAmRaqoJqYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md [__link10]: https://github.com/alexcrichton/curl-rust @@ -179,8 +164,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu [__link13]: https://github.com/http-rs/async-h1 [__link14]: https://github.com/ctz/rustls [__link15]: https://github.com/rustwasm/wasm-bindgen - [__link16]: https://img.shields.io/badge/License-MIT-yellow.svg - [__link17]: https://opensource.org/licenses/MIT + [__link16]: https://opensource.org/licenses/MIT [__link2]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CHANGELOG.md [__link3]: https://github.com/influxdb-rs/influxdb-rust/blob/main/influxdb/Cargo.toml [__link4]: https://docs.rs/influxdb/0.7.2/influxdb/?search=integrations::serde_integration From b09ef4e58a359340b0f601c1e380afd5bd814ec3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:18:54 +0100 Subject: [PATCH 10/18] fix yaml indentation --- .github/workflows/rust.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bbb2a1f6..abac8011 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -63,12 +63,12 @@ jobs: toolchain: nightly nightly: true os: [ubuntu-latest, windows-latest, macOS-latest] - include: - - rust: - name: MSRV - toolchain: stable - nightly: false - os: ubuntu-latest + include: + - rust: + name: MSRV + toolchain: stable + nightly: false + os: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master From e403a1c791ec90f5802df002d42e8293fce811cd Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:20:38 +0100 Subject: [PATCH 11/18] actually we need 1.64 for workspace inheritance --- Cargo.toml | 2 +- README.j2 | 4 ++-- README.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 790d21b9..eb72eb05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] edition = "2018" -rust-version = "1.63" +rust-version = "1.64" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" diff --git a/README.j2 b/README.j2 index adbc59de..25cecd26 100644 --- a/README.j2 +++ b/README.j2 @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.63 + + Minimum Rust Version: 1.64

diff --git a/README.md b/README.md index 330fc0cd..caf7ec95 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.63 + + Minimum Rust Version: 1.64

@@ -155,7 +155,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu @ 2020-2024 Gero Gerke, msrd0 and [contributors]. [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGyIMJPLf2ROkG1r7sBs89LDFG3LXR7q-ZFu2GzrbAmRaqoJqYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg + [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG3PIdJyA0dNfG4kL-oKWKFz4Gw71yx7djCHzG0l_zrk6ftIQYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md [__link10]: https://github.com/alexcrichton/curl-rust From a66b7924d5123fdebc8c01a16a2f0cf56020972b Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:25:20 +0100 Subject: [PATCH 12/18] whatever 1.65 it is --- Cargo.toml | 2 +- README.j2 | 4 ++-- README.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb72eb05..b7a30bbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] edition = "2018" -rust-version = "1.64" +rust-version = "1.65" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" diff --git a/README.j2 b/README.j2 index 25cecd26..ead28b43 100644 --- a/README.j2 +++ b/README.j2 @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.64 + + Minimum Rust Version: 1.65

diff --git a/README.md b/README.md index caf7ec95..f0b7a1c3 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.64 + + Minimum Rust Version: 1.65

@@ -155,7 +155,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu @ 2020-2024 Gero Gerke, msrd0 and [contributors]. [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG3PIdJyA0dNfG4kL-oKWKFz4Gw71yx7djCHzG0l_zrk6ftIQYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg + [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG_RDmlyxxvyrG0rwcLBKoYdvG5It9hbWNgjUGzjD8iBYfsFFYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md [__link10]: https://github.com/alexcrichton/curl-rust From 24f26f469ba1f36166c0170f93c9aa2dcc648e9e Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:30:19 +0100 Subject: [PATCH 13/18] auto-update the rust version in the readme --- Cargo.toml | 1 + README.j2 | 4 ++-- README.md | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b7a30bbd..39c0853f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] edition = "2018" +# always put fully qualified version here, e.g. 1.65.0 (**NOT** 1.65) rust-version = "1.65" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" diff --git a/README.j2 b/README.j2 index ead28b43..cba6ed75 100644 --- a/README.j2 +++ b/README.j2 @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.65 + + Minimum Rust Version: {{ rust_version }}

diff --git a/README.md b/README.md index f0b7a1c3..2dfecba7 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Build with Rust - - Minimum Rust Version: 1.65 + + Minimum Rust Version: 1.65.0

@@ -155,7 +155,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu @ 2020-2024 Gero Gerke, msrd0 and [contributors]. [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEG_RDmlyxxvyrG0rwcLBKoYdvG5It9hbWNgjUGzjD8iBYfsFFYXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg + [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGwiasFGzPvV5Gy6Y1oQPkGrqG7b_RpkdOEifG73obN0GCeV7YXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md [__link10]: https://github.com/alexcrichton/curl-rust From 091351520dd07a0bd094c9317c9714c61e739e3b Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 24 Jan 2025 00:32:44 +0100 Subject: [PATCH 14/18] fix readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2dfecba7..289ed652 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Build with Rust - Minimum Rust Version: 1.65.0 + Minimum Rust Version: 1.65.0

@@ -155,7 +155,7 @@ To communicate with InfluxDB, you can choose the HTTP backend to be used configu @ 2020-2024 Gero Gerke, msrd0 and [contributors]. [contributors]: https://github.com/influxdb-rs/influxdb-rust/graphs/contributors - [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGwiasFGzPvV5Gy6Y1oQPkGrqG7b_RpkdOEifG73obN0GCeV7YXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg + [__cargo_doc2readme_dependencies_info]: ggGkYW0BYXSEGzJ_QpW55zB1G0S-TER-rIfLG2gXv8EYBG3jG1nuXXn-kdx-YXKEG1LaAVLASZMqG5J2qfpyCvbMG_Rohh5BobOmG0DqLv5454SZYWSBgmhpbmZsdXhkYmUwLjcuMg [__link0]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CONTRIBUTING.md [__link1]: https://github.com/influxdb-rs/influxdb-rust/blob/main/CODE_OF_CONDUCT.md [__link10]: https://github.com/alexcrichton/curl-rust From 7177ae25ba4f972b639196dc3f0352dd8ab0aee2 Mon Sep 17 00:00:00 2001 From: Gero Gerke Date: Fri, 24 Jan 2025 17:21:05 +0100 Subject: [PATCH 15/18] chore: update e-mail --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 39c0853f..c66c4af6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] -authors = ["Gero Gerke <11deutron11@gmail.com>", "Dominic "] +authors = ["Gero Gerke ", "Dominic "] edition = "2018" # always put fully qualified version here, e.g. 1.65.0 (**NOT** 1.65) rust-version = "1.65" From 1e685d672167fca5dd1f6d1c38f61cf8464be479 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 4 Apr 2025 17:34:40 +0200 Subject: [PATCH 16/18] remove obviously misleading comment I assume I thought this was necessary for the readme generation, but turns out the readme looks just fine. --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c66c4af6..d66f7d49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ members = ["influxdb", "influxdb_derive", "benches"] [workspace.package] authors = ["Gero Gerke ", "Dominic "] edition = "2018" -# always put fully qualified version here, e.g. 1.65.0 (**NOT** 1.65) rust-version = "1.65" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" From 21abb72e9779917ed5fde6cc34c57c5d266f0147 Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 20 Aug 2025 12:20:03 +0200 Subject: [PATCH 17/18] Update clippy to 1.88; use fallback resolver for clippy as well --- .github/workflows/rust.yml | 8 ++++--- Cargo.toml | 10 ++++++++ influxdb/Cargo.toml | 3 +++ influxdb/src/client/mod.rs | 10 ++++---- .../src/integrations/serde_integration/mod.rs | 14 +++++------ influxdb/src/lib.rs | 6 ++--- influxdb/src/query/line_proto_term.rs | 14 +++++------ influxdb/src/query/mod.rs | 2 +- influxdb/src/query/write_query.rs | 22 ++++++----------- influxdb/tests/derive_integration_tests.rs | 2 +- influxdb/tests/integration_tests.rs | 24 +++++++++---------- influxdb/tests/integration_tests_v2.rs | 1 - influxdb/tests/utilities.rs | 4 ++-- influxdb_derive/Cargo.toml | 3 +++ influxdb_derive/src/writeable.rs | 1 + 15 files changed, 65 insertions(+), 59 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1812c344..ec3bba43 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,13 +24,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.75.0 + - uses: dtolnay/rust-toolchain@1.88.0 with: components: clippy + - name: Update Cargo.lock + run: cargo --config 'resolver.incompatible-rust-versions="fallback"' update - name: Check Clippy lints (reqwest) - run: cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features serde,derive,reqwest-client-rustls -- -D warnings + run: cargo clippy --manifest-path influxdb/Cargo.toml --locked --all-targets --no-default-features --features serde,derive,reqwest-client-rustls -- -D warnings - name: Check Clippy lints (surf) - run: cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features serde,derive,hyper-client -- -D warnings + run: cargo clippy --manifest-path influxdb/Cargo.toml --locked --all-targets --no-default-features --features serde,derive,hyper-client -- -D warnings # this checks that the code is formatted with rustfmt rustfmt: diff --git a/Cargo.toml b/Cargo.toml index d66f7d49..65889457 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ [workspace] members = ["influxdb", "influxdb_derive", "benches"] +resolver = "3" [workspace.package] authors = ["Gero Gerke ", "Dominic "] @@ -10,6 +11,15 @@ rust-version = "1.65" license = "MIT" repository = "https://github.com/influxdb-rs/influxdb-rust" +[workspace.lints.rust] +bare_trait_objects = "forbid" +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin)', 'cfg(tarpaulin_include)'] } + +[workspace.lints.clippy] +multiple_bound_locations = "allow" # clippy has wrong opinions +needless_doctest_main = "allow" +needless_lifetimes = "allow" # False positive in client/mod.rs query fn + [patch.crates-io] influxdb = { path = "./influxdb" } influxdb_derive = { path = "./influxdb_derive" } diff --git a/influxdb/Cargo.toml b/influxdb/Cargo.toml index f88f8417..b0ca36e4 100644 --- a/influxdb/Cargo.toml +++ b/influxdb/Cargo.toml @@ -13,6 +13,9 @@ readme = "README.md" include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"] repository.workspace = true +[lints] +workspace = true + [dependencies] chrono = { version = "0.4.23", features = ["serde"], default-features = false } futures-util = "0.3.17" diff --git a/influxdb/src/client/mod.rs b/influxdb/src/client/mod.rs index 264cfde9..b238a845 100644 --- a/influxdb/src/client/mod.rs +++ b/influxdb/src/client/mod.rs @@ -162,7 +162,7 @@ impl Client { .send() .await .map_err(|err| Error::ProtocolError { - error: format!("{}", err), + error: err.to_string(), })?; const BUILD_HEADER: &str = "X-Influxdb-Build"; @@ -276,13 +276,13 @@ impl Client { let body = res.body_string(); let s = body.await.map_err(|_| Error::DeserializationError { - error: "response could not be converted to UTF-8".to_string(), + error: "response could not be converted to UTF-8".into(), })?; // todo: improve error parsing without serde if s.contains("\"error\"") || s.contains("\"Error\"") { return Err(Error::DatabaseError { - error: format!("influxdb error: \"{}\"", s), + error: format!("influxdb error: {s:?}"), }); } @@ -291,7 +291,7 @@ impl Client { fn auth_if_needed(&self, rb: RequestBuilder) -> RequestBuilder { if let Some(ref token) = self.token { - rb.header("Authorization", format!("Token {}", token)) + rb.header("Authorization", format!("Token {token}")) } else { rb } @@ -314,7 +314,7 @@ mod tests { #[test] fn test_client_debug_redacted_password() { let client = Client::new("https://localhost:8086", "db").with_auth("user", "pass"); - let actual = format!("{:#?}", client); + let actual = format!("{client:#?}"); let expected = indoc! { r#" Client { url: "https://localhost:8086", diff --git a/influxdb/src/integrations/serde_integration/mod.rs b/influxdb/src/integrations/serde_integration/mod.rs index 75b678b7..a6373f1e 100644 --- a/influxdb/src/integrations/serde_integration/mod.rs +++ b/influxdb/src/integrations/serde_integration/mod.rs @@ -71,7 +71,7 @@ impl DatabaseQueryResult { { serde_json::from_value::>(self.results.remove(0)).map_err(|err| { Error::DeserializationError { - error: format!("could not deserialize: {}", err), + error: format!("could not deserialize: {err}"), } }) } @@ -85,7 +85,7 @@ impl DatabaseQueryResult { { serde_json::from_value::>(self.results.remove(0)).map_err(|err| { Error::DeserializationError { - error: format!("could not deserialize: {}", err), + error: format!("could not deserialize: {err}"), } }) } @@ -123,7 +123,7 @@ pub struct TaggedSeries { impl Client { pub async fn json_query(&self, q: ReadQuery) -> Result { let query = q.build().map_err(|err| Error::InvalidQueryError { - error: format!("{}", err), + error: err.to_string(), })?; let read_query = query.get(); @@ -131,9 +131,7 @@ impl Client { if !read_query_lower.contains("select") && !read_query_lower.contains("show") { let error = Error::InvalidQueryError { - error: String::from( - "Only SELECT and SHOW queries supported with JSON deserialization", - ), + error: "Only SELECT and SHOW queries supported with JSON deserialization".into(), }; return Err(error); } @@ -143,7 +141,7 @@ impl Client { parameters.insert("q", read_query); let mut request_builder = self.client.get(url); if let Some(ref token) = self.token { - request_builder = request_builder.header("Authorization", format!("Token {}", token)) + request_builder = request_builder.header("Authorization", format!("Token {token}")) } let request_builder = request_builder.query(¶meters); @@ -179,7 +177,7 @@ impl Client { // Json has another structure, let's try actually parsing it to the type we're deserializing serde_json::from_slice::(&body).map_err(|err| { Error::DeserializationError { - error: format!("serde error: {}", err), + error: format!("serde error: {err}"), } }) } diff --git a/influxdb/src/lib.rs b/influxdb/src/lib.rs index d062e25f..16303bdb 100644 --- a/influxdb/src/lib.rs +++ b/influxdb/src/lib.rs @@ -94,10 +94,6 @@ //! //! [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -#![allow(clippy::needless_doctest_main)] -#![allow(clippy::needless_lifetimes)] // False positive in client/mod.rs query fn -#![forbid(bare_trait_objects)] - macro_rules! cargo_toml { (indent=$indent:literal, $firstfeat:literal $(, $feature:literal)*) => { cargo_toml_private!($indent, "", $firstfeat $(, $feature)*) @@ -107,6 +103,7 @@ macro_rules! cargo_toml { cargo_toml_private!($indent, "default-features = false, ", $firstfeat $(, $feature)*) }; } +use cargo_toml; macro_rules! cargo_toml_private { ($indent:literal, $deffeats:literal, $firstfeat:literal $(, $feature:literal)*) => { @@ -129,6 +126,7 @@ macro_rules! cargo_toml_private { ) }; } +use cargo_toml_private; #[cfg(all(feature = "reqwest", feature = "surf"))] compile_error!("You need to choose between reqwest and surf; enabling both is not supported"); diff --git a/influxdb/src/query/line_proto_term.rs b/influxdb/src/query/line_proto_term.rs index d803c752..6ec6fed6 100644 --- a/influxdb/src/query/line_proto_term.rs +++ b/influxdb/src/query/line_proto_term.rs @@ -49,12 +49,12 @@ impl LineProtoTerm<'_> { } .to_string(), Float(v) => v.to_string(), - SignedInteger(v) => format!("{}i", v), + SignedInteger(v) => format!("{v}i"), UnsignedInteger(v) => { if use_v2 { - format!("{}u", v) + format!("{v}u") } else { - format!("{}i", v) + format!("{v}i") } } Text(v) => format!(r#""{}""#, Self::escape_any(v, "ES_SLASHES)), @@ -71,10 +71,10 @@ impl LineProtoTerm<'_> { "false" } } - .to_string(), - Float(v) => format!(r#"{}"#, v), - SignedInteger(v) => format!(r#"{}"#, v), - UnsignedInteger(v) => format!(r#"{}"#, v), + .into(), + Float(v) => v.to_string(), + SignedInteger(v) => v.to_string(), + UnsignedInteger(v) => v.to_string(), Text(v) => Self::escape_any(v, &SLASHES), } } diff --git a/influxdb/src/query/mod.rs b/influxdb/src/query/mod.rs index 02163c71..e83c2241 100644 --- a/influxdb/src/query/mod.rs +++ b/influxdb/src/query/mod.rs @@ -52,7 +52,7 @@ impl fmt::Display for Timestamp { use Timestamp::*; match self { Nanoseconds(ts) | Microseconds(ts) | Milliseconds(ts) | Seconds(ts) | Minutes(ts) - | Hours(ts) => write!(f, "{}", ts), + | Hours(ts) => write!(f, "{ts}"), } } } diff --git a/influxdb/src/query/write_query.rs b/influxdb/src/query/write_query.rs index 75d8b02e..5f9a5c2a 100644 --- a/influxdb/src/query/write_query.rs +++ b/influxdb/src/query/write_query.rs @@ -122,11 +122,11 @@ impl Display for Type { use Type::*; match self { - Boolean(x) => write!(f, "{}", x), - Float(x) => write!(f, "{}", x), - SignedInteger(x) => write!(f, "{}", x), - UnsignedInteger(x) => write!(f, "{}", x), - Text(text) => write!(f, "{text}", text = text), + Boolean(x) => write!(f, "{x}"), + Float(x) => write!(f, "{x}"), + SignedInteger(x) => write!(f, "{x}"), + UnsignedInteger(x) => write!(f, "{x}"), + Text(text) => write!(f, "{text}"), } } } @@ -187,11 +187,7 @@ impl Query for WriteQuery { } else { LineProtoTerm::TagValue(value).escape() }; - format!( - "{tag}={value}", - tag = escaped_tag_key, - value = escaped_tag_value, - ) + format!("{escaped_tag_key}={escaped_tag_value}") }) .collect::>() .join(","); @@ -213,11 +209,7 @@ impl Query for WriteQuery { } else { LineProtoTerm::FieldValue(value).escape() }; - format!( - "{field}={value}", - field = escaped_field_key, - value = escaped_field_value, - ) + format!("{escaped_field_key}={escaped_field_value}") }) .collect::>() .join(","); diff --git a/influxdb/tests/derive_integration_tests.rs b/influxdb/tests/derive_integration_tests.rs index 1601ce7a..6ecf6121 100644 --- a/influxdb/tests/derive_integration_tests.rs +++ b/influxdb/tests/derive_integration_tests.rs @@ -104,7 +104,7 @@ async fn test_write_and_read_option() { let query = ReadQuery::new("SELECT time, pressure, wind_strength FROM weather_reading"); let result = client.json_query(query).await.and_then(|mut db_result| { - println!("{:?}", db_result); + println!("{db_result:?}"); db_result.deserialize_next::() }); assert_result_ok(&result); diff --git a/influxdb/tests/integration_tests.rs b/influxdb/tests/integration_tests.rs index 01b9fdfc..289ac9c7 100644 --- a/influxdb/tests/integration_tests.rs +++ b/influxdb/tests/integration_tests.rs @@ -25,7 +25,7 @@ async fn test_ping_influx_db_async_std() { assert!(!build.is_empty(), "Build should not be empty"); assert!(!version.is_empty(), "Build should not be empty"); - println!("build: {} version: {}", build, version); + println!("build: {build} version: {version}"); } /// INTEGRATION TEST @@ -42,7 +42,7 @@ async fn test_ping_influx_db_tokio() { assert!(!build.is_empty(), "Build should not be empty"); assert!(!version.is_empty(), "Build should not be empty"); - println!("build: {} version: {}", build, version); + println!("build: {build} version: {version}"); } /// INTEGRATION TEST @@ -78,7 +78,7 @@ async fn test_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("CREATE DATABASE {}", TEST_NAME); + let query = format!("CREATE DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -103,7 +103,7 @@ async fn test_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("DROP DATABASE {}", TEST_NAME); + let query = format!("DROP DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) @@ -128,7 +128,7 @@ async fn test_wrong_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("CREATE DATABASE {}", TEST_NAME); + let query = format!("CREATE DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -176,7 +176,7 @@ async fn test_wrong_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("DROP DATABASE {}", TEST_NAME); + let query = format!("DROP DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -200,7 +200,7 @@ async fn test_non_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("CREATE DATABASE {}", TEST_NAME); + let query = format!("CREATE DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -234,7 +234,7 @@ async fn test_non_authed_write_and_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("DROP DATABASE {}", TEST_NAME); + let query = format!("DROP DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -292,7 +292,7 @@ async fn test_json_non_authed_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("CREATE DATABASE {}", TEST_NAME); + let query = format!("CREATE DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -313,7 +313,7 @@ async fn test_json_non_authed_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("DROP DATABASE {}", TEST_NAME); + let query = format!("DROP DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) @@ -337,7 +337,7 @@ async fn test_json_authed_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("CREATE DATABASE {}", TEST_NAME); + let query = format!("CREATE DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) .await @@ -350,7 +350,7 @@ async fn test_json_authed_read() { || async move { let client = Client::new("http://127.0.0.1:9086", TEST_NAME).with_auth("admin", "password"); - let query = format!("DROP DATABASE {}", TEST_NAME); + let query = format!("DROP DATABASE {TEST_NAME}"); client .query(ReadQuery::new(query)) diff --git a/influxdb/tests/integration_tests_v2.rs b/influxdb/tests/integration_tests_v2.rs index 8c47e2a9..8eb77ad6 100644 --- a/influxdb/tests/integration_tests_v2.rs +++ b/influxdb/tests/integration_tests_v2.rs @@ -9,7 +9,6 @@ use influxdb::{Client, Error, ReadQuery, Timestamp}; /// INTEGRATION TEST /// - /// This test case tests the Authentication #[async_std::test] #[cfg(not(tarpaulin))] diff --git a/influxdb/tests/utilities.rs b/influxdb/tests/utilities.rs index 8b3d5a7a..dc3b17b3 100644 --- a/influxdb/tests/utilities.rs +++ b/influxdb/tests/utilities.rs @@ -30,7 +30,7 @@ where T: Into, { let test_name = name.into(); - let query = format!("CREATE DATABASE {}", test_name); + let query = format!("CREATE DATABASE {test_name}"); create_client(test_name).query(ReadQuery::new(query)).await } @@ -41,7 +41,7 @@ where T: Into, { let test_name = name.into(); - let query = format!("DROP DATABASE {}", test_name); + let query = format!("DROP DATABASE {test_name}"); create_client(test_name).query(ReadQuery::new(query)).await } diff --git a/influxdb_derive/Cargo.toml b/influxdb_derive/Cargo.toml index 7c5df571..093ae634 100644 --- a/influxdb_derive/Cargo.toml +++ b/influxdb_derive/Cargo.toml @@ -13,6 +13,9 @@ readme = "README.md" include = ["src/**/*", "tests/**/*", "Cargo.toml", "LICENSE"] repository.workspace = true +[lints] +workspace = true + [lib] proc-macro = true diff --git a/influxdb_derive/src/writeable.rs b/influxdb_derive/src/writeable.rs index 870f9473..234e5fc3 100644 --- a/influxdb_derive/src/writeable.rs +++ b/influxdb_derive/src/writeable.rs @@ -21,6 +21,7 @@ mod kw { custom_keyword!(ignore); } +#[allow(dead_code)] // TODO do we need to store the keywords? enum FieldAttr { Tag(kw::tag), Ignore(kw::ignore), From c08f91d7bdf31fb22e51a39c6b33143a1a375798 Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 20 Aug 2025 12:24:20 +0200 Subject: [PATCH 18/18] drop default resolver back down to 2 resolver 3 is only supported on Rust 1.84 and up --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 65889457..37508cab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [workspace] members = ["influxdb", "influxdb_derive", "benches"] -resolver = "3" +resolver = "2" [workspace.package] authors = ["Gero Gerke ", "Dominic "]