mtpng icon indicating copy to clipboard operation
mtpng copied to clipboard

Removal of unsafe and panics

Open dgsantana opened this issue 3 years ago • 2 comments

This could be interesting to merge into master. It removes all panics from code, use results where possible, and also removes unsafe code, by using the rust implementation of deflate. There is also an attempt to create some fuzz testing, but probably needs more work.

dgsantana avatar Nov 15 '21 21:11 dgsantana

That's cool, I'll take a look over it when I have a chance!

How's the performance with the pure-Rust deflate? Regressing that is my main worry; I would strongly prefer to keep using zlib if it provides significantly better compression speed, and would not accept patches that degrade performance.

bvibber avatar Nov 17 '21 18:11 bvibber

I haven't done much performance testing, but didn't seen any big changes in speed, when using miniz. But I will make some tests to access performance. I also made miniz a feature, so it's possible to pick if one wants zlib or miniz. I just want to have an option of using a pure rust implementation. I also removed all the panics to avoid having the lib panic.

dgsantana avatar Nov 18 '21 00:11 dgsantana