metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.08k stars 148 forks source link

Remove unneeded unsafe from test #427

Closed rukai closed 8 months ago

rukai commented 8 months ago

I replaced unsafe by making the test use a regular variable instead of a constant, any potential performance here is irreverent as its just a test and now we have one less unsafe to audit.

I also added a SAFETY comment for a suspicious looking unsafe. If you know for sure its fine to have that kind of unsoundness there if its never actually called then I can remove the ambiguity from the phrasing.

rukai commented 8 months ago

Thanks!

I removed the change adding the SAFETY comment to Block because looking at the code, it's not actually safe and I'm going to file an issue to fix that.

Mission accomplished I guess 😎