chore(backend): return a ready future from the composite exchange test mock - #13994
Merged
Conversation
…t mock Rust 1.98 adds clippy::unused_async_trait_impl, which fires on an async trait impl with no .await in its body. With -D warnings this fails the backend lint job.
|
✅ No security or compliance issues detected. Reviewed everything up to 1cffb63. Security Overview
Detected Code Changes
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to test-only code, matches the trait’s desugared async signature, and should resolve the Rust 1.98 clippy failure without affecting runtime behavior.
Pull request overview
Adjusts the exchange::composite unit-test mock to avoid Rust 1.98’s new clippy::unused_async_trait_impl lint (which becomes a hard error under -D warnings), keeping the backend lint gate green during the toolchain bump.
Changes:
- Updates
MockPrimaryProvider::fetch_pricesto return a ready future (std::future::ready(...)) instead of using anasync fnbody with no.await. - Updates test-module imports to include
std::future::{ready, Future}.
File summaries
| File | Description |
|---|---|
src/backend/src/exchange/composite.rs |
Updates the test mock provider implementation to return an immediately-ready future and avoid the new clippy lint. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
AntonioVentilii
enabled auto-merge
September 9, 2026 09:30
DenysKarmazynDFINITY
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Rust 1.98 adds
clippy::unused_async_trait_impl, which fires on anasync fnin a trait impl whose body contains no.await. The backend lint job runs with-D warnings, so it becomes a hard error:This is the only occurrence in the repo.
PanickingPrimaryProvider::fetch_pricesright below it is exempt because its body diverges onpanic!.It currently blocks the toolchain bump in #13776, which fails on nothing else. Landing it separately keeps that PR a pure dependabot bump.
Changes
MockPrimaryProvider::fetch_pricesis a plainfnreturningimpl Futureand wraps its value instd::future::ready, which is the form clippy suggests. Implementing a trait'sasync fnthis way is allowed, and it compiles on 1.97.1 as well, so this does not depend on the bump landing first.Tests
cargo test -p backend --lib exchange::composite: 8 passed, 0 failed../scripts/lint.rust.sh: clean.Both on the pinned 1.97.1. The 1.98 lint itself is verified by CI on #13776 once this is merged and that branch rebases.