diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9d1679d50..4b0c6b0bd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,83 +3,60 @@ name: CI on: push: branches: - - master + - master pull_request: {} env: - MSRV: 1.63.0 + MSRV: 1.64.0 jobs: check-stable: # Run `cargo check` first to ensure that the pushed code at least compiles. runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-features --all-targets + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Check + run: cargo check --workspace --all-features --all-targets check-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - name: cargo doc - working-directory: ${{ matrix.subcrate }} - env: - RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links" - run: cargo doc --all-features --no-deps + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: cargo doc + working-directory: ${{ matrix.subcrate }} + env: + RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links" + run: cargo doc --all-features --no-deps check-msrv: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: "install Rust ${{ env.MSRV }}" - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.MSRV }} - profile: minimal - - name: "install Rust nightly" - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - - name: Select minimal versions - uses: actions-rs/cargo@v1 - with: - command: update - args: -Z minimal-versions - toolchain: nightly - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --all-targets --all-features --locked - toolchain: ${{ env.MSRV }} + - uses: actions/checkout@v4 + - name: "install Rust ${{ env.MSRV }}" + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.MSRV }} + - name: "install Rust nightly" + uses: dtolnay/rust-toolchain@nightly + - name: Select minimal versions + run: cargo update -Z minimal-versions + - name: Check + run: | + rustup default ${{ env.MSRV }} + cargo check --all --all-targets --all-features --locked cargo-hack: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - name: install cargo-hack - uses: taiki-e/install-action@cargo-hack - - name: cargo hack check - working-directory: ${{ matrix.subcrate }} - run: cargo hack check --each-feature --no-dev-deps --workspace + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: install cargo-hack + uses: taiki-e/install-action@cargo-hack + - name: cargo hack check + working-directory: ${{ matrix.subcrate }} + run: cargo hack check --each-feature --no-dev-deps --workspace test-versions: # Test against the stable, beta, and nightly Rust toolchains on ubuntu-latest. @@ -93,68 +70,48 @@ jobs: matrix: rust: [stable, beta, nightly] steps: - - uses: actions/checkout@master - - name: "install Rust ${{ matrix.rust }}" - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - profile: minimal - override: true - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features + - uses: actions/checkout@v4 + - name: "install Rust ${{ matrix.rust }}" + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Run tests + run: cargo test --workspace --all-features test-msrv: needs: check-msrv runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: "install Rust ${{ env.MSRV }}" - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.MSRV }} - profile: minimal - - name: "install Rust nightly" - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - profile: minimal - - name: Select minimal versions - uses: actions-rs/cargo@v1 - with: - command: update - args: -Z minimal-versions - toolchain: nightly - - name: test - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-features --locked - toolchain: ${{ env.MSRV }} + - uses: actions/checkout@v4 + - name: "install Rust ${{ env.MSRV }}" + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.MSRV }} + - name: "install Rust nightly" + uses: dtolnay/rust-toolchain@nightly + - name: Select minimal versions + run: cargo update -Z minimal-versions + - name: test + run: | + rustup default ${{ env.MSRV }} + cargo check --workspace --all-features --locked style: needs: check-stable runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: rustfmt - profile: minimal - - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: rustfmt + run: cargo fmt --all -- --check deny-check: name: cargo-deny check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check + - uses: actions/checkout@v4 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c499f43bd..7c5e6b909 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,19 +12,13 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Install nightly Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: nightly - profile: minimal - name: Generate documentation - uses: actions-rs/cargo@v1 - with: - command: doc - args: --workspace --no-deps --all-features - # Tower uses nightly-only RustDoc features - toolchain: nightly + run: cargo doc --workspace --no-deps --all-features env: # Enable the RustDoc `#[doc(cfg(...))]` attribute. RUSTDOCFLAGS: --cfg docsrs @@ -36,4 +30,3 @@ jobs: build_dir: target/doc env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fca0ac1d5..67d6ccdea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: if: github.repository_owner == 'tower-rs' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: taiki-e/create-gh-release-action@v1.3.0 with: prefix: "(tower)|(tower-[a-z]+)" diff --git a/Cargo.toml b/Cargo.toml index b7d4757b8..6ad0c653b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,23 @@ members = [ "tower-service", "tower-test", ] + +[workspace.dependencies] +futures = "0.3.22" +futures-core = "0.3.22" +futures-util = { version = "0.3.22", default-features = false } +hdrhistogram = { version = "7.0", default-features = false } +http = "1" +indexmap = "2.0.2" +lazy_static = "1.4.0" +pin-project-lite = "0.2.7" +quickcheck = "1" +rand = "0.8" +slab = "0.4" +sync_wrapper = "1" +tokio = "1.6.2" +tokio-stream = "0.1.0" +tokio-test = "0.4" +tokio-util = { version = "0.7.0", default-features = false } +tracing = { version = "0.1.2", default-features = false } +tracing-subscriber = { version = "0.3", default-features = false } diff --git a/README.md b/README.md index a0716a42f..c250b1cee 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ pattern. If your protocol is entirely stream based, Tower may not be a good fit. Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at least** 6 months. When increasing the MSRV, the new Rust version must have been -released at least six months ago. The current MSRV is 1.63.0. +released at least six months ago. The current MSRV is 1.64.0. ## Getting Started diff --git a/examples/Cargo.toml b/examples/Cargo.toml index a39ddb9ca..b8faa4622 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -8,11 +8,11 @@ edition = "2018" # [dependencies] instead. [dev-dependencies] tower = { version = "0.4", path = "../tower", features = ["full"] } -tower-service = "0.3" +tower-service = "0.3" tokio = { version = "1.0", features = ["full"] } rand = "0.8" pin-project = "1.0" -futures = "0.3" +futures = "0.3.22" tracing = "0.1" tracing-subscriber = "0.2" hdrhistogram = "7" diff --git a/tower-layer/CHANGELOG.md b/tower-layer/CHANGELOG.md index b47cf6b55..1ca7a54bf 100644 --- a/tower-layer/CHANGELOG.md +++ b/tower-layer/CHANGELOG.md @@ -1,3 +1,21 @@ +# 0.3.3 (August 1, 2024) + +### Added + +- **builder,util**: add convenience methods for boxing services ([#616]) +- **all**: new functions const when possible ([#760]) + +[#616]: https://github.com/tower-rs/tower/pull/616 +[#760]: https://github.com/tower-rs/tower/pull/760 + +# 0.3.2 (Octpber 10, 2022) + +## Added + +- Implement `Layer` for tuples of up to 16 elements ([#694]) + +[#694]: https://github.com/tower-rs/tower/pull/694 + # 0.3.1 (January 7, 2021) ### Added diff --git a/tower-layer/Cargo.toml b/tower-layer/Cargo.toml index 21883b589..0cf418657 100644 --- a/tower-layer/Cargo.toml +++ b/tower-layer/Cargo.toml @@ -6,13 +6,13 @@ name = "tower-layer" # - README.md # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.3.2" +version = "0.3.3" authors = ["Tower Maintainers "] license = "MIT" readme = "README.md" repository = "https://github.com/tower-rs/tower" homepage = "https://github.com/tower-rs/tower" -documentation = "https://docs.rs/tower-layer/0.3.0-alpha.2" +documentation = "https://docs.rs/tower-layer/0.3.3" description = """ Decorates a `Service` to allow easy composition between `Service`s. """ @@ -22,5 +22,5 @@ edition = "2018" [dependencies] [dev-dependencies] -tower-service = { version = "0.3.0", path = "../tower-service" } -tower = { version = "0.4", path = "../tower" } +tower-service = { path = "../tower-service" } +tower = { path = "../tower" } diff --git a/tower-service/CHANGELOG.md b/tower-service/CHANGELOG.md index 15e4b8eff..948fc3c3d 100644 --- a/tower-service/CHANGELOG.md +++ b/tower-service/CHANGELOG.md @@ -1,6 +1,12 @@ -# Unreleased +# 0.3.2 -- Clarify subtlety around cloning and readiness in the `Service` docs. +- **all**: new functions const when possible ([#760]) +- **documentation**: Clarify subtlety around cloning and readiness in the `Service` docs. ([#622]) +- **documentation**: service: Call inner.poll_ready() in docs when cloning inner ([#679]) + +[#760]: https://github.com/tower-rs/tower/pull/760 +[#622]: https://github.com/tower-rs/tower/pull/662 +[#679]: https://github.com/tower-rs/tower/pull/679 # 0.3.1 (November 29, 2019) diff --git a/tower-service/Cargo.toml b/tower-service/Cargo.toml index 68a5a8768..7f9be7399 100644 --- a/tower-service/Cargo.toml +++ b/tower-service/Cargo.toml @@ -6,13 +6,13 @@ name = "tower-service" # - README.md # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.3.2" +version = "0.3.3" authors = ["Tower Maintainers "] license = "MIT" readme = "README.md" repository = "https://github.com/tower-rs/tower" homepage = "https://github.com/tower-rs/tower" -documentation = "https://docs.rs/tower-service/0.3.1" +documentation = "https://docs.rs/tower-service/0.3.3" description = """ Trait representing an asynchronous, request / response based, client or server. """ @@ -22,7 +22,7 @@ edition = "2018" [dependencies] [dev-dependencies] -http = "0.2" +http = { workspace = true } tower-layer = { version = "0.3", path = "../tower-layer" } -tokio = { version = "1", features = ["macros", "time"] } -futures = "0.3" +tokio = { workspace = true, features = ["macros", "time"] } +futures = { workspace = true } diff --git a/tower-test/CHANGELOG.md b/tower-test/CHANGELOG.md index c115895d1..48fd6e69f 100644 --- a/tower-test/CHANGELOG.md +++ b/tower-test/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.5.0 (August 1, 2023) + +- Update dependency on tower to 0.5.0-alpha.1. + # 0.4.0 (January 7, 2021) - Updated `tokio-test` dependency to 0.4 diff --git a/tower-test/Cargo.toml b/tower-test/Cargo.toml index 2c01cae21..24c7d7e22 100644 --- a/tower-test/Cargo.toml +++ b/tower-test/Cargo.toml @@ -6,7 +6,7 @@ name = "tower-test" # - README.md # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.4.0" +version = "0.4.1" authors = ["Tower Maintainers "] license = "MIT" readme = "README.md" @@ -20,12 +20,12 @@ categories = ["asynchronous", "network-programming"] edition = "2018" [dependencies] -futures-util = { version = "0.3", default-features = false } -tokio = { version = "1.0", features = ["sync"] } -tokio-test = "0.4" +futures-util = { workspace = true } +tokio = { workspace = true, features = ["sync"] } +tokio-test = { workspace = true } tower-layer = { version = "0.3", path = "../tower-layer" } tower-service = { version = "0.3", path = "../tower-service" } -pin-project-lite = "0.2" +pin-project-lite = { workspace = true } [dev-dependencies] -tokio = { version = "1.0", features = ["macros"] } +tokio = { workspace = true, features = ["macros"] } diff --git a/tower/CHANGELOG.md b/tower/CHANGELOG.md index 22a40d683..bee0a86c6 100644 --- a/tower/CHANGELOG.md +++ b/tower/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Unreleased +# 0.5.1 + +- Fix minimum version of `tower-layer` dependency ([#787]) + +[#787]: https://github.com/tower-rs/tower/pull/787 + +# 0.5.0 ### Fixed @@ -17,11 +23,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 future ([#652]) - **retry**: **Breaking Change** `retry::Policy::retry` now accepts `&mut Req` and `&mut Res` instead of the previous mutable versions. This increases the flexibility of the retry policy. To update, update your method signature to include `mut` for both parameters. ([#584]) +- **retry**: **Breaking Change** Change Policy to accept &mut self ([#681]) +- **retry**: Add generic backoff utilities ([#685]) +- **retry**: Add Budget trait. This allows end-users to implement their own budget and bucket implementations. ([#703]) +- **reconnect**: **Breaking Change** Remove unused generic parameter from `Reconnect::new` ([#755]) +- **ready-cache**: Allow iteration over ready services ([#700]) +- **discover**: Implement `Clone` for Change ([#701]) +- **util**: Add a BoxCloneServiceLayer ([#708]) +- **rng**: use a simpler random 2-sampler ([#716]) +- **filter**: Derive `Clone` for `AsyncFilterLayer` ([#731]) +- **general**: Update IndexMap ([#741]) +- **MSRV**: Increase MSRV to 1.63.0 ([#741]) - +[#702]: https://github.com/tower-rs/tower/pull/702 [#652]: https://github.com/tower-rs/tower/pull/652 [#584]: https://github.com/tower-rs/tower/pull/584 -[#702]: https://github.com/tower-rs/tower/pull/702 +[#681]: https://github.com/tower-rs/tower/pull/681 +[#685]: https://github.com/tower-rs/tower/pull/685 +[#703]: https://github.com/tower-rs/tower/pull/703 +[#755]: https://github.com/tower-rs/tower/pull/755 +[#700]: https://github.com/tower-rs/tower/pull/700 +[#701]: https://github.com/tower-rs/tower/pull/701 +[#708]: https://github.com/tower-rs/tower/pull/708 +[#716]: https://github.com/tower-rs/tower/pull/716 +[#731]: https://github.com/tower-rs/tower/pull/731 +[#741]: https://github.com/tower-rs/tower/pull/741 # 0.4.12 (February 16, 2022) diff --git a/tower/Cargo.toml b/tower/Cargo.toml index 3e199a844..6e810b3cb 100644 --- a/tower/Cargo.toml +++ b/tower/Cargo.toml @@ -1,18 +1,15 @@ [package] name = "tower" # When releasing to crates.io: -# - Update doc url -# - Cargo.toml -# - README.md +# - Update README.md # - Update CHANGELOG.md. # - Create "vX.X.X" git tag. -version = "0.4.13" +version = "0.5.1" authors = ["Tower Maintainers "] license = "MIT" readme = "README.md" repository = "https://github.com/tower-rs/tower" homepage = "https://github.com/tower-rs/tower" -documentation = "https://docs.rs/tower/0.4.12" description = """ Tower is a library of modular and reusable components for building robust clients and servers. @@ -20,7 +17,7 @@ clients and servers. categories = ["asynchronous", "network-programming"] keywords = ["io", "async", "non-blocking", "futures", "service"] edition = "2018" -rust-version = "1.63.0" +rust-version = "1.64.0" [features] @@ -65,35 +62,35 @@ timeout = ["pin-project-lite", "tokio/time"] util = ["__common", "futures-util", "pin-project-lite", "sync_wrapper"] [dependencies] -tower-layer = { version = "0.3.1", path = "../tower-layer" } -tower-service = { version = "0.3.1", path = "../tower-service" } +tower-layer = { version = "0.3.3", path = "../tower-layer" } +tower-service = { version = "0.3.3", path = "../tower-service" } -futures-core = { version = "0.3", optional = true } -futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true } -hdrhistogram = { version = "7.0", optional = true, default-features = false } -indexmap = { version = "2.0.2", optional = true } -slab = { version = "0.4", optional = true } -tokio = { version = "1.6", optional = true, features = ["sync"] } -tokio-stream = { version = "0.1.0", optional = true } -tokio-util = { version = "0.7.0", default-features = false, optional = true } -tracing = { version = "0.1.2", default-features = false, features = ["std"], optional = true } -pin-project-lite = { version = "0.2.7", optional = true } -sync_wrapper = { version = "0.1.1", optional = true } +futures-core = { workspace = true, optional = true } +futures-util = { workspace = true, features = ["alloc"], optional = true } +hdrhistogram = { workspace = true, optional = true } +indexmap = { workspace = true, optional = true } +slab = { workspace = true, optional = true } +tokio = { workspace = true, features = ["sync"], optional = true } +tokio-stream = { workspace = true, optional = true } +tokio-util = { workspace = true, optional = true } +tracing = { workspace = true, features = ["std"], optional = true } +pin-project-lite = { workspace = true, optional = true } +sync_wrapper = { workspace = true, optional = true } [dev-dependencies] -futures = "0.3" -hdrhistogram = { version = "7.0", default-features = false } -pin-project-lite = "0.2.7" -tokio = { version = "1.6.2", features = ["macros", "sync", "test-util", "rt-multi-thread"] } -tokio-stream = "0.1" -tokio-test = "0.4" +futures = { workspace = true } +hdrhistogram = { workspace = true } +pin-project-lite = { workspace = true } +tokio = { workspace = true, features = ["macros", "sync", "test-util", "rt-multi-thread"] } +tokio-stream = { workspace = true } +tokio-test = { workspace = true } tower-test = { version = "0.4", path = "../tower-test" } -tracing = { version = "0.1.2", default-features = false, features = ["std"] } -tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] } -http = "0.2" -lazy_static = "1.4.0" -rand = { version = "0.8", features = ["small_rng"] } -quickcheck = "1" +tracing = { workspace = true, features = ["std"] } +tracing-subscriber = { workspace = true, features = ["fmt", "ansi"] } +http = { workspace = true } +lazy_static = { workspace = true } +rand = { workspace = true, features = ["small_rng"] } +quickcheck = { workspace = true } [package.metadata.docs.rs] all-features = true diff --git a/tower/README.md b/tower/README.md index b277f7433..fa9e208d6 100644 --- a/tower/README.md +++ b/tower/README.md @@ -74,7 +74,7 @@ application code, libraries providing middleware implementations, and libraries that implement servers and/or clients for various network protocols. -Depending on your particular use case, you might use Tower in several ways: +Depending on your particular use case, you might use Tower in several ways: * **Implementing application logic** for a networked program. You might use the [`Service`] trait to model your application's behavior, and use @@ -141,14 +141,14 @@ To get started using all of Tower's optional middleware, add this to your `Cargo.toml`: ```toml -tower = { version = "0.4", features = ["full"] } +tower = { version = "0.5.1", features = ["full"] } ``` Alternatively, you can only enable some features. For example, to enable only the [`retry`] and [`timeout`][timeouts] middleware, write: ```toml -tower = { version = "0.4", features = ["retry", "timeout"] } +tower = { version = "0.5.1", features = ["retry", "timeout"] } ``` See [here][all_layers] for a complete list of all middleware provided by @@ -174,7 +174,7 @@ Tower. Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at least** 6 months. When increasing the MSRV, the new Rust version must have been -released at least six months ago. The current MSRV is 1.63.0. +released at least six months ago. The current MSRV is 1.64.0. ## License diff --git a/tower/src/builder/mod.rs b/tower/src/builder/mod.rs index a990dbfd0..8f081d234 100644 --- a/tower/src/builder/mod.rs +++ b/tower/src/builder/mod.rs @@ -325,7 +325,7 @@ impl ServiceBuilder { /// // ...but we want to call that service with a `usize`. What do we do? /// /// let usize_svc = ServiceBuilder::new() - /// // Add a middlware that converts the request type to a `String`: + /// // Add a middleware that converts the request type to a `String`: /// .map_request(|request: usize| format!("{}", request)) /// // ...and wrap the string service with that middleware: /// .service(string_svc); diff --git a/tower/src/lib.rs b/tower/src/lib.rs index a509b89cb..179edfbec 100644 --- a/tower/src/lib.rs +++ b/tower/src/lib.rs @@ -22,7 +22,7 @@ //! response or an error. This abstraction can be used to model both clients and //! servers. //! -//! Generic components, like [timeouts], [rate limiting], and [load balancing], +//! Generic components, like [`timeout`], [rate limiting], and [load balancing], //! can be modeled as [`Service`]s that wrap some inner service and apply //! additional behavior before or after the inner service is called. This allows //! implementing these components in a protocol-agnostic, composable way. Typically, @@ -130,7 +130,7 @@ //! ``` //! //! Alternatively, you can only enable some features. For example, to enable -//! only the [`retry`] and [`timeout`][timeouts] middleware, write: +//! only the [`retry`] and [`timeout`] middleware, write: //! //! ```toml //! tower = { version = "0.4", features = ["retry", "timeout"] } @@ -144,11 +144,10 @@ //! //! Tower will keep a rolling MSRV (minimum supported Rust version) policy of **at //! least** 6 months. When increasing the MSRV, the new Rust version must have been -//! released at least six months ago. The current MSRV is 1.63.0. +//! released at least six months ago. The current MSRV is 1.64.0. //! //! [`Service`]: crate::Service //! [`Layer`]: crate::Layer -//! [timeouts]: crate::timeout //! [rate limiting]: crate::limit::rate //! [load balancing]: crate::balance //! [`ServiceBuilder`]: crate::ServiceBuilder diff --git a/tower/src/load/mod.rs b/tower/src/load/mod.rs index 2f9a37371..e47558b48 100644 --- a/tower/src/load/mod.rs +++ b/tower/src/load/mod.rs @@ -26,7 +26,7 @@ //! [`TrackCompletion`] trait, with [`CompleteOnResponse`] as the default type. The behavior of //! [`CompleteOnResponse`] is what you would normally expect for a request-response cycle: when the //! response is produced, the request is considered "finished", and load goes down. This can be -//! overriden by your own user-defined type to track more complex request completion semantics. See +//! overridden by your own user-defined type to track more complex request completion semantics. See //! the documentation for [`completion`] for more details. //! //! # Examples diff --git a/tower/src/load/pending_requests.rs b/tower/src/load/pending_requests.rs index 2b30de8dd..2721633fd 100644 --- a/tower/src/load/pending_requests.rs +++ b/tower/src/load/pending_requests.rs @@ -45,6 +45,7 @@ pub struct Count(usize); /// Tracks an in-flight request by reference count. #[derive(Debug)] +#[allow(dead_code)] pub struct Handle(RefCount); // ===== impl PendingRequests ===== diff --git a/tower/src/ready_cache/cache.rs b/tower/src/ready_cache/cache.rs index b3aec3781..a62990339 100644 --- a/tower/src/ready_cache/cache.rs +++ b/tower/src/ready_cache/cache.rs @@ -42,7 +42,7 @@ use tracing::{debug, trace}; /// the _pending_ set to be driven to readiness again. /// /// When `ReadyCache::check_ready*` returns `false`, it indicates that the -/// specified service is _not_ ready. If an error is returned, this indicats that +/// specified service is _not_ ready. If an error is returned, this indicates that /// the server failed and has been removed from the cache entirely. /// /// [`ReadyCache::evict`] can be used to remove a service from the cache (by key), diff --git a/tower/src/util/call_all/common.rs b/tower/src/util/call_all/common.rs index 3b3f8938c..9f2490b6d 100644 --- a/tower/src/util/call_all/common.rs +++ b/tower/src/util/call_all/common.rs @@ -126,7 +126,7 @@ where let svc = this .service .as_mut() - .expect("Using CallAll after extracing inner Service"); + .expect("Using CallAll after extracting inner Service"); if let Err(e) = ready!(svc.poll_ready(cx)) { // Set eof to prevent the service from being called again after a `poll_ready` error diff --git a/tower/src/util/call_all/ordered.rs b/tower/src/util/call_all/ordered.rs index ba8310016..9a283916b 100644 --- a/tower/src/util/call_all/ordered.rs +++ b/tower/src/util/call_all/ordered.rs @@ -168,7 +168,7 @@ impl common::Drive for FuturesOrdered { } fn push(&mut self, future: F) { - FuturesOrdered::push(self, future) + FuturesOrdered::push_back(self, future) } fn poll(&mut self, cx: &mut Context<'_>) -> Poll> { diff --git a/tower/src/util/rng.rs b/tower/src/util/rng.rs index de9975661..9b6d307d9 100644 --- a/tower/src/util/rng.rs +++ b/tower/src/util/rng.rs @@ -174,7 +174,7 @@ mod tests { let mut r = HasherRng::default(); match super::sample_floyd2(&mut r, 2) { [0, 1] | [1, 0] => (), - err => panic!("{err:?}"), + array => panic!("unexpected inplace boundaries: {:?}", array), } } }