Comment on Functional State Machines in Rust: Typestate and Newtype PatternsparentComments−stouset12dMaking functions that must be called in a specific, pre-defined order is the problem.Forcing it to be done correctly through the type system is a neat trick, but better is to design it so the trick wasn’t needed in the first place.
Comments
Making functions that must be called in a specific, pre-defined order is the problem.
Forcing it to be done correctly through the type system is a neat trick, but better is to design it so the trick wasn’t needed in the first place.