Return Result instead of asserting when reading
Logout22 opened this issue · 6 comments
When calling read_bytes etc., instead of asserting and crashing the program when overreading a buffer, I would like to seize Rusts builtin Result to signal failure. Existing code could easily adopt the new interface using calls to unwrap(). Do you think that would be a good idea? If so I can also implement it.
It's a great idea, feel free to submit a PR if you want to implement it, I'm a bit short on time currently ;)
Cool, thanks! Same here, but I will try to come up with something in the next couple of weeks.
Hi, I finished my work and opened pull request #7 . Please let me know what you think.
Thanks for your contribution @Logout22
No problem, thank you for accepting my changes! I had some fun too developing this branch. Do you plan to do a release some time in the future?
Yes, I currently have some issues with my crates.io account, (probably because I changed my github username) but I've asked a friend (@Shiroy) with whom I share the publish right to this crate to do it :)
In the mean time, you can use
bytebuffer = { git = "https://github.com/terahlunah/rust-bytebuffer" }
in your cargo.toml to have the lastest version ;)