diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-08-13 14:21:10 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-08-13 14:31:14 -0400 |
| commit | 4ace27830ffea715c30f366765aeb231572c60ec (patch) | |
| tree | d07ceb9f445bd4c9601273e1de002addcbd8c645 /src/token | |
| parent | bfcdc3fde5a39eb1d51a30c34d31330ea88b242f (diff) | |
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.
Diffstat (limited to 'src/token')
| -rw-r--r-- | src/token/repo/auth.rs | 4 | ||||
| -rw-r--r-- | src/token/repo/token.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/token/repo/auth.rs b/src/token/repo/auth.rs index 68a81c7..5976d4a 100644 --- a/src/token/repo/auth.rs +++ b/src/token/repo/auth.rs @@ -9,11 +9,11 @@ use crate::{ }; pub trait Provider { - fn auth(&mut self) -> Auth; + fn auth(&mut self) -> Auth<'_>; } impl Provider for Transaction<'_, Sqlite> { - fn auth(&mut self) -> Auth { + fn auth(&mut self) -> Auth<'_> { Auth(self) } } diff --git a/src/token/repo/token.rs b/src/token/repo/token.rs index cbc50ab..7ac4ac5 100644 --- a/src/token/repo/token.rs +++ b/src/token/repo/token.rs @@ -11,11 +11,11 @@ use crate::{ }; pub trait Provider { - fn tokens(&mut self) -> Tokens; + fn tokens(&mut self) -> Tokens<'_>; } impl Provider for Transaction<'_, Sqlite> { - fn tokens(&mut self) -> Tokens { + fn tokens(&mut self) -> Tokens<'_> { Tokens(self) } } |
