sile / libflate

A Rust implementation of DEFLATE algorithm and related formats (ZLIB, GZIP)
https://docs.rs/libflate
MIT License
178 stars 35 forks source link

Use take_mut instead of a bespoke unsafe block with mem::replace #37

Closed Shnatsel closed 5 years ago

Shnatsel commented 5 years ago

mem::uninitialized is getting deprecated because it's impossible to use it safely in generic code.

On the other hand, take_mut has been reviewed by the Unsafe Code Guidelines WG and has been found to be sound.

codecov-io commented 5 years ago

Codecov Report

Merging #37 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #37   +/-   ##
=======================================
  Coverage   91.46%   91.46%           
=======================================
  Files          14       14           
  Lines        1301     1301           
=======================================
  Hits         1190     1190           
  Misses        111      111
Impacted Files Coverage Δ
src/lib.rs 100% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a2971a4...ffeff7c. Read the comment docs.

Shnatsel commented 5 years ago

FWIW this borrow-checks but I have not tested this