This probably isn't super idiomatic, but it makes the crate much more generic.
This is based on issue #12 . A few hacky things had to be done to get this to work, namely a custom HasChar trait and changing the peek_char() function return Option<char> instead of Option<&char>. All of the tests still pass (with one syntactic change), so hopefully this isn't a big deal.
This probably isn't super idiomatic, but it makes the crate much more generic.
This is based on issue #12 . A few hacky things had to be done to get this to work, namely a custom
HasChar
trait and changing thepeek_char()
function returnOption<char>
instead ofOption<&char>
. All of the tests still pass (with one syntactic change), so hopefully this isn't a big deal.