dequbed / rsasl

The Rust SASL framework
MIT License
12 stars 6 forks source link

Document `unsafe` usages in rsasl #27

Open dequbed opened 1 year ago

dequbed commented 1 year ago

At the time of writing there are 9 unsafe blocks in rsasl code, 8 of which are in rsasl proper, with a final one in the SCRAM parser. Most of them are inherently safe casts, but the safety of them is not explicitly documented but based on tribal knowledge (e.g. #[repr(transparent)] struct A(B) meaning A(B) has the exact same representation as B and thus making a cast from &B to &A a safe no-op).

Those should be documented better.

Oh and I need to look at the more dodgy ones, like Mechname::const_new.