aldanor / hdf5-rust

HDF5 for Rust
https://docs.rs/hdf5
Apache License 2.0
308 stars 82 forks source link

Mark various internal functions as unsafe #254

Closed rytheo closed 8 months ago

rytheo commented 1 year ago

Found various functions that should be unsafe since they take raw pointer arguments and must assume they point to valid data.

Made string_from_fixed_bytes panic on invalid UTF-8 instead of marking it unsafe, but marking it unsafe is a valid alternative if the unwrap call significantly reduces performance.

rytheo commented 1 year ago

@mulimoen changing hdf5/src/util.rs shouldn't be a breaking change; looking at hdf5/src/lib.rs, it seems like none of the functions in util are accessible outside the crate. Am I missing something?

mulimoen commented 1 year ago

@rytheo You are right, after closer examination it is not exported publicly. Note to self: Should mark these functions/modules as pub(crate)