uazu / stakker

A lightweight low-level single-threaded actor runtime
https://uazu.github.io/stakker/
Apache License 2.0
167 stars 9 forks source link

Allow returning `Self` instead of `Option<Self>` for Prep methods that always go to Ready #21

Open uazu opened 2 years ago

uazu commented 2 years ago

Option provides a From implementation for T such that Option::from(val) on both T and Option<T> will result in Option<T>. So all Prep calls could be wrapped in Option::from(...) to handle both. This needs testing to check that it causes no issues. It also requires some consideration to be sure that it won't confuse coders who might forget that there's a way to delay moving to the Ready state.