Skip to content

Commit e6326d8

Browse files
authored
Fix clippy lints (#114)
* fix clippy lints * update CI * bump MSRV to 1.56 for dependencies
1 parent 2cf40fc commit e6326d8

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

.github/workflows/rust.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: README Format Check
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v3
1515
- uses: dtolnay/rust-toolchain@nightly
1616
- run: bash ./auxiliary/update_cargo-readme.sh
1717
- run: bash ./auxiliary/check_readme_consistency.sh
@@ -20,12 +20,15 @@ jobs:
2020
name: Style Checks (stable/ubuntu-latest)
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v3
2424
- uses: dtolnay/rust-toolchain@nightly
2525
with:
26-
components: "rustfmt,clippy"
26+
components: rustfmt
2727
- name: Check code formatting
2828
run: cargo fmt --all -- --check
29+
- uses: dtolnay/[email protected]
30+
with:
31+
components: clippy
2932
- name: Check Clippy lints (reqwest)
3033
run: cargo clippy --manifest-path influxdb/Cargo.toml --all-targets --no-default-features --features use-serde,derive,reqwest-client -- -D warnings
3134
- name: Check Clippy lints (surf)
@@ -36,11 +39,11 @@ jobs:
3639
runs-on: ${{ matrix.os }}
3740
strategy:
3841
matrix:
39-
rust_release: ["1.53", stable, nightly]
42+
rust_release: ["1.56", stable, nightly]
4043
os: [ubuntu-latest, windows-latest, macOS-latest]
4144

4245
steps:
43-
- uses: actions/checkout@v1
46+
- uses: actions/checkout@v3
4447
- uses: dtolnay/rust-toolchain@master
4548
with:
4649
toolchain: ${{ matrix.rust_release }}
@@ -70,13 +73,13 @@ jobs:
7073
INFLUXDB_USER_PASSWORD: password
7174

7275
steps:
73-
- uses: actions/checkout@v1
76+
- uses: actions/checkout@v3
7477
- uses: dtolnay/rust-toolchain@stable
7578
- run: cargo test --manifest-path=./influxdb/Cargo.toml --no-default-features --features 'use-serde derive ${{ matrix.http-backend }}' --no-fail-fast
7679

7780
coverage:
78-
name: Code Coverage (stable/ubuntu-20.04)
79-
runs-on: ubuntu-20.04
81+
name: Code Coverage (stable/ubuntu-latest)
82+
runs-on: ubuntu-latest
8083
services:
8184
influxdb:
8285
image: influxdb:1.8
@@ -94,7 +97,7 @@ jobs:
9497
INFLUXDB_USER_PASSWORD: password
9598

9699
steps:
97-
- uses: actions/checkout@v2
100+
- uses: actions/checkout@v3
98101
- uses: dtolnay/rust-toolchain@stable
99102

100103
- name: Get Rust Version
@@ -103,9 +106,9 @@ jobs:
103106

104107
- name: Get Tarpaulin Version
105108
id: tarpaulin-version
106-
run: echo "::set-output name=VERSION::$(wget -qO- 'https://api.github.com/repos/xd009642/tarpaulin/releases/latest' | jq -r '.tag_name')"
109+
run: echo "::set-output name=VERSION::$(wget -qO- 'https://crates.io/api/v1/crates/cargo-tarpaulin' | jq -r '.crate.max_stable_version')"
107110

108-
- uses: actions/cache@v2
111+
- uses: actions/cache@v3
109112
with:
110113
path: |
111114
~/.cargo/bin/cargo-tarpaulin
@@ -133,24 +136,24 @@ jobs:
133136
RUST_BACKTRACE: 1
134137
RUST_LOG: info
135138

136-
- uses: actions/upload-artifact@v2
139+
- uses: actions/upload-artifact@v3
137140
with:
138141
name: tarpaulin-report
139142
path: |
140143
tarpaulin-report.json
141144
tarpaulin-report.html
142145
143146
pages:
144-
runs-on: ubuntu-20.04
147+
runs-on: ubuntu-latest
145148
needs:
146149
- coverage
147-
if: github.ref == 'refs/heads/master'
150+
if: github.ref == 'refs/heads/main'
148151
steps:
149-
- uses: actions/checkout@v2
152+
- uses: actions/checkout@v3
150153
with:
151154
ref: gh-pages
152155

153-
- uses: actions/download-artifact@v2
156+
- uses: actions/download-artifact@v3
154157
with:
155158
name: tarpaulin-report
156159

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html">
29-
<img src="https://img.shields.io/badge/rustc-1.53+-yellow.svg" alt='Minimum Rust Version' />
28+
<a href="https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html">
29+
<img src="https://img.shields.io/badge/rustc-1.56+-yellow.svg" alt='Minimum Rust Version' />
3030
</a>
3131
</p>
3232

README.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<a href="https://www.rust-lang.org/en-US/">
2626
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
2727
</a>
28-
<a href="https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html">
29-
<img src="https://img.shields.io/badge/rustc-1.53+-yellow.svg" alt='Minimum Rust Version' />
28+
<a href="https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html">
29+
<img src="https://img.shields.io/badge/rustc-1.56+-yellow.svg" alt='Minimum Rust Version' />
3030
</a>
3131
</p>
3232

influxdb/src/query/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use consts::{MILLIS_PER_SECOND, MINUTES_PER_HOUR, NANOS_PER_MILLI, SECONDS_PER_M
3535
#[cfg(feature = "derive")]
3636
pub use influxdb_derive::InfluxDbWriteable;
3737

38-
#[derive(PartialEq, Debug, Copy, Clone)]
38+
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
3939
pub enum Timestamp {
4040
Nanoseconds(u128),
4141
Microseconds(u128),
@@ -127,11 +127,11 @@ impl<Q: Query> Query for &Q {
127127

128128
impl<Q: Query> Query for Box<Q> {
129129
fn build(&self) -> Result<ValidQuery, Error> {
130-
Q::build(&*self)
130+
Q::build(self)
131131
}
132132

133133
fn get_type(&self) -> QueryType {
134-
Q::get_type(&*self)
134+
Q::get_type(self)
135135
}
136136
}
137137

@@ -192,7 +192,7 @@ impl PartialEq<&str> for ValidQuery {
192192
}
193193

194194
/// Internal Enum used to decide if a `POST` or `GET` request should be sent to InfluxDB. See [InfluxDB Docs](https://docs.influxdata.com/influxdb/v1.7/tools/api/#query-http-endpoint).
195-
#[derive(PartialEq, Debug)]
195+
#[derive(PartialEq, Eq, Debug)]
196196
pub enum QueryType {
197197
ReadQuery,
198198
/// write query with precision

0 commit comments

Comments
 (0)