Owez / torro

A correct and easy-to-use BitTorrent library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove references to `char` and `str` in bencode parser

Owez opened this issue · comments

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 with char, because char has no place in bencode handling. You might get char's from doing String::from_utf8 if you have reason to expect it to be utf8, though I'd suggest to use the Result variant there, because you don't wanna panic on user input.