Skip to content

Commit 231f6a1

Browse files
byfnoelGuillaumeGomez
authored andcommitted
Fix lifetime warning by explicitly telling the compiler to infer from context
For context: ``` --> src/repositories/updater.rs:311:36 | | pub(crate) fn repository_name(url: &str) -> Option<RepositoryName> { | ^^^^ -------------- 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 ````
1 parent d532482 commit 231f6a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/repositories/updater.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl RepositoryStatsUpdater {
308308
}
309309
}
310310

311-
pub(crate) fn repository_name(url: &str) -> Option<RepositoryName> {
311+
pub(crate) fn repository_name(url: &str) -> Option<RepositoryName<'_>> {
312312
static RE: LazyLock<Regex> = LazyLock::new(|| {
313313
Regex::new(r"https?://(?P<host>[^/]+)/(?P<owner>[\w\._/-]+)/(?P<repo>[\w\._-]+)").unwrap()
314314
});

0 commit comments

Comments
 (0)