Remove references to `char` and `str` in bencode parser
Owez opened this issue · comments
Owen Griffiths commented
Issue ported from discord:
I'd suggest you'd just use
u8
as your token type, and declare consts for the special meaning characters, instead of this enum withchar
, becausechar
has no place in bencode handling. You might getchar
's from doingString::from_utf8
if you have reason to expect it to beutf8
, though I'd suggest to use theResult
variant there, because you don't wanna panic on user input.