Skip to content

Commit cf1d6c3

Browse files
authored
Merge branch 'master' into feat/776-workspace-dependencies
2 parents b89d23e + 88a7d3e commit cf1d6c3

File tree

8 files changed

+39
-89
lines changed

8 files changed

+39
-89
lines changed

Diff for: .github/workflows/CI.yml

+28-71
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,16 @@ jobs:
1414
# Run `cargo check` first to ensure that the pushed code at least compiles.
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@master
18-
- uses: actions-rs/toolchain@v1
19-
with:
20-
toolchain: stable
21-
profile: minimal
22-
override: true
17+
- uses: actions/checkout@v4
18+
- uses: dtolnay/rust-toolchain@stable
2319
- name: Check
24-
uses: actions-rs/cargo@v1
25-
with:
26-
command: check
27-
args: --workspace --all-features --all-targets
20+
run: cargo check --workspace --all-features --all-targets
2821

2922
check-docs:
3023
runs-on: ubuntu-latest
3124
steps:
32-
- uses: actions/checkout@master
33-
- uses: actions-rs/toolchain@v1
34-
with:
35-
toolchain: stable
36-
profile: minimal
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
3727
- name: cargo doc
3828
working-directory: ${{ matrix.subcrate }}
3929
env:
@@ -43,38 +33,25 @@ jobs:
4333
check-msrv:
4434
runs-on: ubuntu-latest
4535
steps:
46-
- uses: actions/checkout@master
36+
- uses: actions/checkout@v4
4737
- name: "install Rust ${{ env.MSRV }}"
48-
uses: actions-rs/toolchain@v1
38+
uses: dtolnay/rust-toolchain@master
4939
with:
5040
toolchain: ${{ env.MSRV }}
51-
profile: minimal
5241
- name: "install Rust nightly"
53-
uses: actions-rs/toolchain@v1
54-
with:
55-
toolchain: nightly
56-
profile: minimal
42+
uses: dtolnay/rust-toolchain@nightly
5743
- name: Select minimal versions
58-
uses: actions-rs/cargo@v1
59-
with:
60-
command: update
61-
args: -Z minimal-versions
62-
toolchain: nightly
44+
run: cargo update -Z minimal-versions
6345
- name: Check
64-
uses: actions-rs/cargo@v1
65-
with:
66-
command: check
67-
args: --all --all-targets --all-features --locked
68-
toolchain: ${{ env.MSRV }}
46+
run: |
47+
rustup default ${{ env.MSRV }}
48+
cargo check --all --all-targets --all-features --locked
6949
7050
cargo-hack:
7151
runs-on: ubuntu-latest
7252
steps:
73-
- uses: actions/checkout@master
74-
- uses: actions-rs/toolchain@v1
75-
with:
76-
toolchain: stable
77-
profile: minimal
53+
- uses: actions/checkout@v4
54+
- uses: dtolnay/rust-toolchain@stable
7855
- name: install cargo-hack
7956
uses: taiki-e/install-action@cargo-hack
8057
- name: cargo hack check
@@ -93,68 +70,48 @@ jobs:
9370
matrix:
9471
rust: [stable, beta, nightly]
9572
steps:
96-
- uses: actions/checkout@master
73+
- uses: actions/checkout@v4
9774
- name: "install Rust ${{ matrix.rust }}"
98-
uses: actions-rs/toolchain@v1
75+
uses: dtolnay/rust-toolchain@master
9976
with:
10077
toolchain: ${{ matrix.rust }}
101-
profile: minimal
102-
override: true
10378
- name: Run tests
104-
uses: actions-rs/cargo@v1
105-
with:
106-
command: test
107-
args: --workspace --all-features
79+
run: cargo test --workspace --all-features
10880

10981
test-msrv:
11082
needs: check-msrv
11183
runs-on: ubuntu-latest
11284
steps:
113-
- uses: actions/checkout@master
85+
- uses: actions/checkout@v4
11486
- name: "install Rust ${{ env.MSRV }}"
115-
uses: actions-rs/toolchain@v1
87+
uses: dtolnay/rust-toolchain@master
11688
with:
11789
toolchain: ${{ env.MSRV }}
118-
profile: minimal
11990
- name: "install Rust nightly"
120-
uses: actions-rs/toolchain@v1
121-
with:
122-
toolchain: nightly
123-
profile: minimal
91+
uses: dtolnay/rust-toolchain@nightly
12492
- name: Select minimal versions
125-
uses: actions-rs/cargo@v1
126-
with:
127-
command: update
128-
args: -Z minimal-versions
129-
toolchain: nightly
93+
run: cargo update -Z minimal-versions
13094
- name: test
131-
uses: actions-rs/cargo@v1
132-
with:
133-
command: check
134-
args: --workspace --all-features --locked
135-
toolchain: ${{ env.MSRV }}
95+
run: |
96+
rustup default ${{ env.MSRV }}
97+
cargo check --workspace --all-features --locked
13698
13799
style:
138100
needs: check-stable
139101
runs-on: ubuntu-latest
140102
steps:
141-
- uses: actions/checkout@master
142-
- uses: actions-rs/toolchain@v1
103+
- uses: actions/checkout@v4
104+
- uses: dtolnay/rust-toolchain@stable
143105
with:
144-
toolchain: stable
145106
components: rustfmt
146-
profile: minimal
147107
- name: rustfmt
148-
uses: actions-rs/cargo@v1
149-
with:
150-
command: fmt
151-
args: --all -- --check
108+
run: cargo fmt --all -- --check
152109

153110
deny-check:
154111
name: cargo-deny check
155112
runs-on: ubuntu-latest
156113
steps:
157-
- uses: actions/checkout@v1
114+
- uses: actions/checkout@v4
158115
- uses: EmbarkStudios/cargo-deny-action@v1
159116
with:
160117
command: check

Diff for: .github/workflows/publish.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@ jobs:
1212

1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v1
15+
uses: actions/checkout@v4
1616
- name: Install nightly Rust
17-
uses: actions-rs/toolchain@v1
17+
uses: dtolnay/rust-toolchain@master
1818
with:
1919
toolchain: nightly
20-
profile: minimal
2120
- name: Generate documentation
22-
uses: actions-rs/cargo@v1
23-
with:
24-
command: doc
25-
args: --workspace --no-deps --all-features
26-
# Tower uses nightly-only RustDoc features
27-
toolchain: nightly
21+
run: cargo doc --workspace --no-deps --all-features
2822
env:
2923
# Enable the RustDoc `#[doc(cfg(...))]` attribute.
3024
RUSTDOCFLAGS: --cfg docsrs
@@ -36,4 +30,3 @@ jobs:
3630
build_dir: target/doc
3731
env:
3832
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39-

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: github.repository_owner == 'tower-rs'
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- uses: taiki-e/[email protected]
1818
with:
1919
prefix: "(tower)|(tower-[a-z]+)"

Diff for: examples/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ edition = "2018"
88
# [dependencies] instead.
99
[dev-dependencies]
1010
tower = { version = "0.4", path = "../tower", features = ["full"] }
11-
tower-service = "0.3"
11+
tower-service = "0.3"
1212
tokio = { version = "1.0", features = ["full"] }
1313
rand = "0.8"
1414
pin-project = "1.0"
15-
futures = "0.3"
15+
futures = "0.3.22"
1616
tracing = "0.1"
1717
tracing-subscriber = "0.2"
1818
hdrhistogram = "7"

Diff for: tower/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//! response or an error. This abstraction can be used to model both clients and
2323
//! servers.
2424
//!
25-
//! Generic components, like [timeouts], [rate limiting], and [load balancing],
25+
//! Generic components, like [`timeout`], [rate limiting], and [load balancing],
2626
//! can be modeled as [`Service`]s that wrap some inner service and apply
2727
//! additional behavior before or after the inner service is called. This allows
2828
//! implementing these components in a protocol-agnostic, composable way. Typically,
@@ -130,7 +130,7 @@
130130
//! ```
131131
//!
132132
//! Alternatively, you can only enable some features. For example, to enable
133-
//! only the [`retry`] and [`timeout`][timeouts] middleware, write:
133+
//! only the [`retry`] and [`timeout`] middleware, write:
134134
//!
135135
//! ```toml
136136
//! tower = { version = "0.4", features = ["retry", "timeout"] }
@@ -148,7 +148,6 @@
148148
//!
149149
//! [`Service`]: crate::Service
150150
//! [`Layer`]: crate::Layer
151-
//! [timeouts]: crate::timeout
152151
//! [rate limiting]: crate::limit::rate
153152
//! [load balancing]: crate::balance
154153
//! [`ServiceBuilder`]: crate::ServiceBuilder

Diff for: tower/src/load/pending_requests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub struct Count(usize);
4545

4646
/// Tracks an in-flight request by reference count.
4747
#[derive(Debug)]
48+
#[allow(dead_code)]
4849
pub struct Handle(RefCount);
4950

5051
// ===== impl PendingRequests =====

Diff for: tower/src/util/call_all/ordered.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<F: Future> common::Drive<F> for FuturesOrdered<F> {
168168
}
169169

170170
fn push(&mut self, future: F) {
171-
FuturesOrdered::push(self, future)
171+
FuturesOrdered::push_back(self, future)
172172
}
173173

174174
fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Option<F::Output>> {

Diff for: tower/src/util/rng.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ mod tests {
174174
let mut r = HasherRng::default();
175175
match super::sample_floyd2(&mut r, 2) {
176176
[0, 1] | [1, 0] => (),
177-
err => panic!("{err:?}"),
177+
array => panic!("unexpected inplace boundaries: {:?}", array),
178178
}
179179
}
180180
}

0 commit comments

Comments
 (0)