Skip to content

Commit 2a8a6b5

Browse files
authored
Merge pull request #105 from 3scale-rs/update-msrv-and-fix-warnings
Update MSRV and fix linter warnings
2 parents 224d9fb + 0bee7a1 commit 2a8a6b5

File tree

21 files changed

+93
-54
lines changed

21 files changed

+93
-54
lines changed
File renamed without changes.

.github/workflows/audit.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
audit_check:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
2224

2325
- uses: actions-rs/audit-check@v1
2426
with:

.github/workflows/ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ jobs:
3030
experimental: true
3131
cargo_flags: --all-features
3232
# MSRV
33-
- rust: 1.60.0
33+
- rust: 1.65.0
3434
experimental: false
3535
cargo_flags: ""
36+
- rust: 1.81.0
37+
experimental: false
38+
cargo_flags: --all-features
3639

3740
steps:
38-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v4
3942
with:
4043
submodules: recursive
4144

.github/workflows/clippy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
clippy_check:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: recursive
1919

@@ -28,4 +28,4 @@ jobs:
2828
- uses: actions-rs/clippy-check@v1
2929
with:
3030
token: ${{ secrets.GITHUB_TOKEN }}
31-
args: --all-targets --all-features -- -D warnings
31+
args: --all-targets --all-features -- -D warnings -D clippy::all

.github/workflows/coverage.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
with:
1616
submodules: recursive
1717

@@ -24,21 +24,21 @@ jobs:
2424
override: true
2525

2626
- name: Install cargo-tarpaulin
27-
uses: baptiste0928/cargo-install@v2
27+
uses: baptiste0928/cargo-install@v3
2828
with:
2929
crate: cargo-tarpaulin
3030

3131
- name: Run cargo tarpaulin
3232
run: cargo tarpaulin --all-features -o Xml -- --test-threads 1
3333

3434
- name: Archive code coverage results
35-
uses: actions/upload-artifact@v2
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: code-coverage-report
3838
path: cobertura.xml
3939

4040
- name: Upload to codecov.io
41-
uses: codecov/codecov-action@v1
41+
uses: codecov/codecov-action@v5
4242
with:
4343
token: ${{ secrets.CODECOV_TOKEN }}
4444
file: cobertura.xml

.github/workflows/format.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
with:
1919
submodules: recursive
2020

Cargo.toml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
rust-version = "1.60"
2+
rust-version = "1.65"
33
edition = "2021"
44
name = "threescalers"
55
description = "3scale API client library for Rust"
@@ -31,7 +31,6 @@ http-types = ["dep:http_types"]
3131
# Add in conversions for reqwest's crate types
3232
reqwest-async = ["dep:reqwest", "http-types"]
3333
reqwest-sync = ["dep:reqwest", "reqwest?/blocking", "http-types"]
34-
#reqwest-sync = ["dep:reqwest", "http-types"]
3534
reqwest-all = ["reqwest-async", "reqwest-sync"]
3635
# Add in conversions for curl's crate types
3736
curl-easy = ["dep:curl"]
@@ -47,20 +46,20 @@ rest-mappings-serde = ["dep:serde"]
4746
serde = ["dep:serde", "rest-mappings-serde"]
4847

4948
[dependencies]
50-
percent-encoding = "^2"
51-
http_types = { version = "^0.2", package = "http", optional = true }
52-
reqwest = { version = ">= 0.10, < 0.12", optional = true }
53-
curl = { version = "^0.4", optional = true }
54-
serde = { version = "^1", optional = true, default-features = false, features = ["alloc", "derive"] }
55-
serde-xml-rs = { version = "^0.6", optional = true }
56-
chrono = { version = "^0.4", optional = true, default-features = false }
57-
no-std-compat = { version = "^0.4", features = ["alloc"] }
58-
anyhow = { version = "^1", default-features = false }
59-
regex = { version = "^1", optional = true, default-features = false, features = ["perf"] }
49+
percent-encoding = "2.1"
50+
http_types = { version = "1", package = "http", optional = true }
51+
reqwest = { version = "0.12", optional = true }
52+
curl = { version = "0.4.10", optional = true }
53+
serde = { version = "1.0.103", optional = true, default-features = false, features = ["alloc", "derive"] }
54+
serde-xml-rs = { version = "0.6", optional = true }
55+
chrono = { version = "0.4.23", optional = true, default-features = false }
56+
no-std-compat = { version = "0.4", features = ["alloc"] }
57+
anyhow = { version = "1.0.16", default-features = false }
58+
regex = { version = "1.3.2", optional = true, default-features = false, features = ["perf"] }
6059
# lazy_static has a "negative" no_std flag rather than an additive "std" flag :/
6160
# We'll now recommend users that want no_std to enable the "lazy_static/spin_no_std" feature,
6261
# since enabling it unconditionally here forces everyone, including std users, to use spinlocks.
63-
lazy_static = { version = "^1", optional = true }
62+
lazy_static = { version = "1.4", optional = true }
6463

6564
[[example]]
6665
name = "reqwest-report"
@@ -75,6 +74,9 @@ name = "curl-easy2-report"
7574
required-features = ["curl-easy2"]
7675

7776
[dev-dependencies]
78-
serde_json = "^1.0"
79-
itertools = "^0.10"
80-
rand = "^0.8"
77+
serde_json = "1"
78+
itertools = "0.10"
79+
rand = "0.8"
80+
81+
[lints.rust]
82+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("never_type"))'] }

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ convenience implementations for some comonly used HTTP clients.
55

66
## Rust library crate for the 3scale Service Management API
77

8-
![Minimum rustc version](https://img.shields.io/badge/rustc-1.60.0+-green.svg)
8+
![Minimum rustc version](https://img.shields.io/badge/rustc-1.65.0+-green.svg)
99
[![docs.rs](https://docs.rs/threescalers/badge.svg)](https://docs.rs/threescalers)
1010
[![Build Status](https://github.com/3scale-rs/threescalers/actions/workflows/ci.yaml/badge.svg)](https://travis-ci.org/3scale-rs/threescalers)
1111
[![codecov.io](https://codecov.io/gh/3scale-rs/threescalers/coverage.svg?branch=master)](https://codecov.io/gh/3scale-rs/threescalers/branch/master)
@@ -29,6 +29,9 @@ unnecessarily.
2929
Some features that pull in dependencies might require higher rustc versions based on
3030
the dependencies' MSRV.
3131

32+
The current MSRV is 1.65.0, but if you enable any feature related to reqwest, the
33+
MSRV is bumped to 1.81.0.
34+
3235
## no_std
3336

3437
`#[no_std]` support can be achieved _if_ allocations are allowed and disabling the default

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This build.rs file contains an inline vendored fork of autocfg with feature
22
// detection capabilities. Please skip to the `autocfg` module if you want to
33
// check the details.
4+
#![allow(clippy::all, clippy::pedantic)]
45

56
static REQUIRED_MAJOR: usize = 1;
67
static REQUIRED_MINOR: usize = 60;
@@ -15,14 +16,27 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1516
);
1617
}
1718

19+
let check_cfg_enabled = ac.probe_rustc_version(1, 80);
20+
21+
if check_cfg_enabled {
22+
println!("cargo:rustc-check-cfg=cfg(supports_never_type, feature_never_type)");
23+
}
1824
if !ac.emit_type_cfg("!", "supports_never_type") {
1925
ac.emit_features_with(&["never_type"], |fac| {
2026
fac.emit_type_cfg("!", "supports_never_type")
2127
});
2228
}
2329

30+
if check_cfg_enabled {
31+
println!("cargo:rustc-check-cfg=cfg(feature_test)");
32+
}
2433
ac.emit_feature("test");
2534

35+
// Emit feature dependency of http-types: requires Never type.
36+
// We are forced to do this until Cargo knows about private features.
37+
#[cfg(feature = "http-types")]
38+
println!("cargo:rustc-cfg=feature=\"never_type\"");
39+
2640
autocfg::rerun_path("build.rs");
2741

2842
Ok(())

src/api_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'a> Builder<'a> {
8686
use std::borrow::Cow;
8787

8888
impl<'a> ApiCall<'a> {
89-
pub fn builder(service: &'a Service) -> Builder {
89+
pub fn builder(service: &'a Service) -> Builder<'a> {
9090
Builder::new(service)
9191
}
9292

0 commit comments

Comments
 (0)