Owez / torro

A correct and easy-to-use BitTorrent library
MIT License
9 stars 0 forks source link

Finishing Torrent::new parsing #16

Closed Owez closed 4 years ago

Owez commented 4 years ago

Need to finish the bencode for Torrent::new as next main goal to have a completed Torrent structure can then use to modify later

Owez commented 4 years ago

Commiting all directly to master for this as anything that is committed passes cargo test beforehand, will close issue once finished

Owez commented 4 years ago

Code is becoming ugly and looks copied and pasted but it's so complex and generally long that this is really the best way to implement the bep spec

Owez commented 4 years ago

Finished first version fee13d9e6127cc0883c76495ce823f9904dd0762 :tada:

Need to refactor/rewrite this though as so many ugly match {} that can be fixed by chaining with the new impl Bencode { bytestring(), int(), dict(), list() } functions like so:

get_dict_item(...).byte_string().ok_or(TorrentCreationError::AnnounceWrongType).and_then(vecu8_to_string)?

Will close once this is completed