rust-random / getrandom

A small cross-platform library for retrieving random data from (operating) system source
Apache License 2.0
275 stars 180 forks source link

Tweak `util_libc::open_readonly` #434

Closed newpavlov closed 4 months ago

newpavlov commented 4 months ago

Based on discussion in #432, open_readonly now accepts &[u8] instead of &str for path and asserts that it contains at least one zero byte. This allows to make the function safe and compiler should be able to remove the assert since we use static paths.