BurntSushi / fst

Represent large sets and maps compactly with finite state transducers.
The Unlicense
1.78k stars 126 forks source link

Return the correct state if accept_eof matches #140

Open noeddl opened 2 years ago

noeddl commented 2 years ago

When implementing accept_eof from the Automaton trait I noticed that it did not behave as I expected when using the automaton in a search_with_state. In cases in which accept_eof produced a match the state returned in the stream was not the one returned by accept_eof.

The fix in this PR works well for my use case, I hope it confirms to how accept_eof is intended to work.