-
-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
I am implementing an async trait for all T
where &T: tower::Service<...>
. Since Service::execute
takes &mut self
, this trait impl says mut self: &Self
(since you cannot say mut &self
). This is fine with a plain async trait, but #[async_trait]
triggers the clippy lint:
warning: the type of the `self` parameter does not need to be arbitrary
--> ic-agent/src/agent/mod.rs:1865:13
|
1865 | mut self: &'a Self,
| ^^^^^^^^^^^^^^ help: consider to change this parameter to: `&'a self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type
= note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default
because the generated code starts with &self
and let
-binds it later. It would be good if async_trait
silenced the warning instead of the caller.
Metadata
Metadata
Assignees
Labels
No labels