Fix mismatched_lifetime_syntaxes warnings

Fixes a bunch of warnings like this:

```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> window/src/os/macos/window.rs:670:23
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle, HandleError> {
    |                       ^^^^^            ------------- 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
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
    |                                                     ++++
```

This lint was added in Rust 1.89: https://github.com/rust-lang/rust/issues/141787
This commit is contained in:
Rebecca Turner authored and Wez Furlong committed 2025-09-09 07:05:12 -07:00
1 parent 6a493f88fa
commit bf9a2aeeba
36 files changed
+67 -61

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ fn compute_repo_dir(url: &str) -> String {
dir
}
fn get_remote(repo: &Repository) -> anyhow::Result<Option<Remote>> {
fn get_remote(repo: &Repository) -> anyhow::Result<Option<Remote<'_>>> {
let remotes = repo.remotes()?;
for remote in remotes.iter() {
if let Some(name) = remote {
@@ -184,7 +184,7 @@ impl RepoSpec {
}
}
fn require_plugin(lua: &Lua, url: String) -> anyhow::Result<Value> {
fn require_plugin(lua: &Lua, url: String) -> anyhow::Result<Value<'_>> {
let spec = RepoSpec::parse(url)?;
if !spec.is_checked_out() {
+3 -3
View File
@@ -62,19 +62,19 @@ fn toml_encode_pretty(_: &Lua, value: LuaValue) -> mlua::Result<String> {
toml::to_string_pretty(&json).map_err(|err| mlua::Error::external(format!("{err:#}")))
}
fn json_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue> {
fn json_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue<'_>> {
let value =
serde_json::from_str(&text).map_err(|err| mlua::Error::external(format!("{err:#}")))?;
json_value_to_lua_value(lua, value)
}
fn yaml_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue> {
fn yaml_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue<'_>> {
let value: JValue =
serde_yaml::from_str(&text).map_err(|err| mlua::Error::external(format!("{err:#}")))?;
json_value_to_lua_value(lua, value)
}
fn toml_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue> {
fn toml_decode(lua: &Lua, text: String) -> mlua::Result<LuaValue<'_>> {
let value: JValue =
toml::from_str(&text).map_err(|err| mlua::Error::external(format!("{err:#}")))?;
json_value_to_lua_value(lua, value)