errors.fyi community error code reference
E0317
rust

Missing else Branch

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.

References

← all namespaces