From dcc9da4cc5b377b00038de59f94a96234012132d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Thu, 19 Oct 2023 17:28:48 +0200 Subject: [PATCH] ra_machine: Make the `version/0` callback return a `version()` type [Why] 0 is a valid machine version. It is the default one when the callback is undefined. However, the callback spec states that a `pos_integer()` should be returned which forbids a version of 0. [How] Simply change the callback return value to `version()`. This makes 0 a valid return value and reuses the existing type already used elsewhere. --- src/ra_machine.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ra_machine.erl b/src/ra_machine.erl index f8fa5cdb..814e3030 100644 --- a/src/ra_machine.erl +++ b/src/ra_machine.erl @@ -251,7 +251,7 @@ -callback snapshot_module() -> module(). --callback version() -> pos_integer(). +-callback version() -> version(). -callback which_module(version()) -> module().