uutils / platform-info

A cross-platform way to get information about your machine
MIT License
85 stars 25 forks source link

Don't use `mem::uninitialized` #23

Closed wackbyte closed 2 years ago

wackbyte commented 2 years ago

Replaced with MaybeUninit::{uninit,assume_init} in addition to mem::zeroed and ptr::null_mut where they were more suitable. I also put a few (very basic) notes about safety.

If someone could test on Windows that would be nice :slightly_smiling_face:

codecov[bot] commented 2 years ago

Codecov Report

Merging #23 (f781a54) into main (88b5cbd) will increase coverage by 0.45%. The diff coverage is 62.50%.

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   44.58%   45.04%   +0.45%     
==========================================
  Files           4        4              
  Lines         240      242       +2     
  Branches       37       37              
==========================================
+ Hits          107      109       +2     
  Misses        119      119              
  Partials       14       14              
Flag Coverage Δ
macos_latest 90.00% <66.66%> (+0.25%) :arrow_up:
ubuntu_latest ?
windows_latest 40.18% <60.00%> (+0.27%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/windows.rs 33.50% <60.00%> (+0.34%) :arrow_up:
src/unix.rs 90.90% <66.66%> (+0.43%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

sylvestre commented 2 years ago

please run rustfmt on your change :)

sylvestre commented 2 years ago

merci

sylvestre commented 2 years ago

are you planning other changes or should I push 1.0.1 ?

wackbyte commented 2 years ago

yep, that should be it. go ahead!

sylvestre commented 2 years ago

done, thanks https://crates.io/crates/platform-info