An if expression without an else block is used in a context that expects a non-() type. Because an if without else returns () on the non-taken branch, its result cannot be assigned to a variable of another type.
E0317
rust An if expression without an else block is used in a context that expects a non-() type. Because an if without else returns () on the non-taken branch, its result cannot be assigned to a variable of another type.