From 4ace27830ffea715c30f366765aeb231572c60ec Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 13 Aug 2025 14:21:10 -0400 Subject: Rust 1.89: Add elided lifetime parameters (`'_`) where appropriate. Rust 1.89 added a new warning: warning: hiding a lifetime that's elided elsewhere is confusing --> src/setup/repo.rs:4:14 | 4 | fn setup(&mut self) -> Setup; | ^^^^^^^^^ ----- the same lifetime is hidden here | | | the lifetime is elided here | = help: the same lifetime is referred to in inconsistent ways, making the signature confusing help: use `'_` for type paths | 4 | fn setup(&mut self) -> Setup<'_>; | ++++ I don't entirely agree with the style advice here, but lifetime elision style is an evolving area in Rust and I'd rather track the Rust team's recommendations than invent my own, so I've added all of them. --- src/test/fixtures/future.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/test/fixtures') diff --git a/src/test/fixtures/future.rs b/src/test/fixtures/future.rs index c0fa528..86aba53 100644 --- a/src/test/fixtures/future.rs +++ b/src/test/fixtures/future.rs @@ -15,7 +15,7 @@ pub trait Expect: Sized { // and panics with the provided message if it is not. // // For stream operations, can be used to assert immediate completion. - fn expect_ready(self, message: &str) -> Ready + fn expect_ready(self, message: &str) -> Ready<'_, Self> where Self: Future; @@ -26,7 +26,7 @@ pub trait Expect: Sized { // // For stream operations, can be used to assert that completion hasn't happened // yet. - fn expect_wait(self, message: &str) -> Wait + fn expect_wait(self, message: &str) -> Wait<'_, Self> where Self: Future; @@ -37,7 +37,7 @@ pub trait Expect: Sized { // // For stream operations, can be used to assert that the stream has at least one // message. - fn expect_some(self, message: &str) -> Some + fn expect_some(self, message: &str) -> Some<'_, Self> where Self: Future>; @@ -47,27 +47,27 @@ pub trait Expect: Sized { // fixed. // // For stream operations, can be used to assert that the stream has ended. - fn expect_none(self, message: &str) -> None + fn expect_none(self, message: &str) -> None<'_, Self> where Self: Future>; } impl Expect for stream::Next<'_, St> { - fn expect_ready(self, message: &str) -> Ready { + fn expect_ready(self, message: &str) -> Ready<'_, Self> { Ready { future: self, message, } } - fn expect_wait(self, message: &str) -> Wait { + fn expect_wait(self, message: &str) -> Wait<'_, Self> { Wait { future: self, message, } } - fn expect_some(self, message: &str) -> Some + fn expect_some(self, message: &str) -> Some<'_, Self> where Self: Future>, { @@ -77,7 +77,7 @@ impl Expect for stream::Next<'_, St> { } } - fn expect_none(self, message: &str) -> None + fn expect_none(self, message: &str) -> None<'_, Self> where Self: Future>, { @@ -89,21 +89,21 @@ impl Expect for stream::Next<'_, St> { } impl Expect for stream::Collect { - fn expect_ready(self, message: &str) -> Ready { + fn expect_ready(self, message: &str) -> Ready<'_, Self> { Ready { future: self, message, } } - fn expect_wait(self, message: &str) -> Wait { + fn expect_wait(self, message: &str) -> Wait<'_, Self> { Wait { future: self, message, } } - fn expect_some(self, message: &str) -> Some + fn expect_some(self, message: &str) -> Some<'_, Self> where Self: Future>, { @@ -113,7 +113,7 @@ impl Expect for stream::Collect { } } - fn expect_none(self, message: &str) -> None + fn expect_none(self, message: &str) -> None<'_, Self> where Self: Future>, { -- cgit v1.2.3