Closed notgull closed 1 year ago
It would be more idiomatic to return a ZST error type of some kind as a Result instead of an Option.
I work with Rust for a long time and never seen such pattern. Option<T>
is Result<T, ()>
, if you think about it.
So the current code is correct and I have no plans on changing it.
PS: Paint methods that return Option<()>
will be replaced with just log warnings eventually.
The pattern in this crate seems to be that fallible functions (like
Pixmap::new()
) returnOption<T>
instead ofResult<T, Error>
. I was wondering if it was a deliberate choice to useOption<T>
instead of having error types? It would be more idiomatic to return a ZST error type of some kind as aResult
instead of anOption
.