Fix documentation comment for State::overwrite_next (#1291)

This commit is contained in:
Tomasz Sterna 2021-01-23 22:18:28 +01:00 committed by GitHub
parent 7166a28baf
commit f2b73eaa8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -247,7 +247,7 @@ impl<T: Clone> State<T> {
Ok(())
}
/// Same as [Self::queue], but if there is already a next state, it will be overwritten instead of failing
/// Same as [Self::set_next], but if there is already a next state, it will be overwritten instead of failing
pub fn overwrite_next(&mut self, state: T) -> Result<(), StateError> {
if std::mem::discriminant(&self.current) == std::mem::discriminant(&state) {
return Err(StateError::AlreadyInState);