Return a meaningful error instead of using unit as an error type
This fixes the last remaining Clippy warning, see https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
Alternatively we could decide to suppress this Clippy warning. Adding the error type requires a few lines of code and this is actually not public API, but Clippy doesn't understand that.