Skip to content

Commit

Permalink
Fix compiler warning regarding future errors
Browse files Browse the repository at this point in the history
As preparation for an upcoming Rust compiler release, the following
warning was generated and needed to be fixed:

    warning: this function depends on never type fallback being `()`
       --> src/main.rs:247:1
        |
    247 | fn bump(version: String) -> Result<()> {
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
        = note: for more information, see issue #123748 <rust-lang/rust#123748>
        = help: specify the types explicitly
    note: in edition 2024, the requirement `!: LuaUserData` will fail
       --> src/main.rs:268:22
        |
    268 |                     .call(())
        |                      ^^^^
        = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
  • Loading branch information
FloGa committed Jan 11, 2025
1 parent c0ff721 commit 609ba8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fn bump(version: String) -> Result<()> {
if let Some(hooks) = &hooks {
if let Some(pre_func) = hooks.get("pre_func") {
pre_func
.call(())
.call::<_, ()>(())
.map_err(|source| Error::LuaPreFuncFailed { source })?;
}
}
Expand All @@ -275,7 +275,7 @@ fn bump(version: String) -> Result<()> {
if let Some(hooks) = &hooks {
if let Some(post_func) = hooks.get("post_func") {
post_func
.call(())
.call::<_, ()>(())
.map_err(|source| Error::LuaPostFuncFailed { source })?;
}
}
Expand Down

0 comments on commit 609ba8f

Please sign in to comment.