error missing-annotation
Публичная функция должна указывать типы параметров и результата.
What it means#
Parameter types and return types of pub and pub(api) functions MUST be written out (§3). Only private functions may omit the return type and let it be inferred from a body of the form => e.
Example#
pub fn add(a: i32, b: i32) => a + b // <- missing-annotation (no return type)error
missing-annotation
How to fix#
pub fn add(a: i32, b: i32) -> i32 => a + bWrite the return type (and parameter types) explicitly. For pub(api) functions effects must be declared as well (effects).