Skip to content

Commit 96ea14d

Browse files
cargo: fixing new lint errors
``` 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 { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
1 parent 1dea5b1 commit 96ea14d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightway-client/src/keepalive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ mod tests {
357357
.any(|ev| matches!(ev, FixtureEvent::TimeoutExpired))
358358
}
359359

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

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

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

0 commit comments

Comments
 (0)