Skip to content

Commit

Permalink
cargo: fixing new lint errors
Browse files Browse the repository at this point in the history
```
warning: impl trait in impl method signature does not match trait method signature
   --> lightway-client/src/keepalive.rs:360:41
    |
29  |     fn sleep_for_interval(&self) -> impl std::future::Future<Output = ()> + std::marker::Send;
    |                                     --------------------------------------------------------- return type from trait method defined here
...
360 |         fn sleep_for_interval(&self) -> futures::future::BoxFuture<()> {
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
    = note: we are soliciting feedback, see issue #121718 <rust-lang/rust#121718> for more information
    = note: `#[warn(refining_impl_trait_internal)]` on by default
help: replace the return type so that it matches the trait
    |
360 |         fn sleep_for_interval(&self) -> impl futures::Future<Output = ()> + std::marker::Send {
    |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  • Loading branch information
kp-mariappan-ramasamy committed Jun 14, 2024
1 parent 1dea5b1 commit 96ea14d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightway-client/src/keepalive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mod tests {
.any(|ev| matches!(ev, FixtureEvent::TimeoutExpired))
}

fn sleep_for_interval(&self) -> futures::future::BoxFuture<()> {
fn sleep_for_interval(&self) -> impl futures::Future<Output = ()> + std::marker::Send {
println!("sleep_for_interval");
let mut inner = self.0.lock().unwrap();

Expand All @@ -368,7 +368,7 @@ mod tests {
Box::pin(async move { rx.await.unwrap() })
}

fn sleep_for_timeout(&self) -> futures::future::BoxFuture<()> {
fn sleep_for_timeout(&self) -> impl futures::Future<Output = ()> + std::marker::Send {
println!("sleep_for_timeout");
let mut inner = self.0.lock().unwrap();

Expand Down

0 comments on commit 96ea14d

Please sign in to comment.