You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was making an API that returns a tokio::sync::oneshot::Receiver from an async function when I noticed that the clippy::async_returns_async lint doesn't like me doing this. Originally I thought that this is in fact a poor API design choice, but this doesn't happen in normal async fns. It turns out that this lint error comes from the async_trait macro's expansion.
Here's my code example. The error ultimately comes from the fact that the function's code gets wrapped in an async move block, which according to Clippy shouldn't be returning a future.
I think just putting a #[allow(clippy::async_yields_async)] on the generated function should be sufficient to deal with this.
The text was updated successfully, but these errors were encountered:
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [async-trait](https://github.com/dtolnay/async-trait) | dependencies | patch | `0.1.62` -> `0.1.64` |
---
### Release Notes
<details>
<summary>dtolnay/async-trait</summary>
### [`v0.1.64`](https://github.com/dtolnay/async-trait/releases/tag/0.1.64)
[Compare Source](dtolnay/async-trait@0.1.63...0.1.64)
- Suppress async_yields_async clippy correctness lint in generated code ([#​236](dtolnay/async-trait#236), [#​237](dtolnay/async-trait#237))
### [`v0.1.63`](https://github.com/dtolnay/async-trait/releases/tag/0.1.63)
[Compare Source](dtolnay/async-trait@0.1.62...0.1.63)
- Do not require Sync on unused shared reference arguments ([#​232](dtolnay/async-trait#232), [#​233](dtolnay/async-trait#233))
- Make expansion of nested `_` and `..` patterns edition independent ([#​234](dtolnay/async-trait#234), [#​235](dtolnay/async-trait#235))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTQuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExNi4xIn0=-->
Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Co-authored-by: crapStone <crapstone01@gmail.com>
Co-authored-by: crapStone <crapstone@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1750
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
I was making an API that returns a
tokio::sync::oneshot::Receiver
from an async function when I noticed that theclippy::async_returns_async
lint doesn't like me doing this. Originally I thought that this is in fact a poor API design choice, but this doesn't happen in normalasync fn
s. It turns out that this lint error comes from theasync_trait
macro's expansion.Here's my code example. The error ultimately comes from the fact that the function's code gets wrapped in an
async move
block, which according to Clippy shouldn't be returning a future.I think just putting a
#[allow(clippy::async_yields_async)]
on the generated function should be sufficient to deal with this.The text was updated successfully, but these errors were encountered: