Feedback requested: book on API type patterns

There is one way to spin this that it can be considered an advantage: the match mem::replace(&mut self.state, State::Faulted) { pattern means that an accidental panic! in the implementation leaves it in an error state, which one could argue is better than it being only half-updated.

4 Likes