arrayfire / arrayfire-rust

Rust wrapper for ArrayFire
BSD 3-Clause "New" or "Revised" License
814 stars 57 forks source link

The scope of the unsafe block can be appropriately reduced #319

Closed peamaeq closed 2 years ago

9prady9 commented 2 years ago

@peamaeq Please fix the commit message.

9prady9 commented 2 years ago

please also address the formatting and clippy issues

peamaeq commented 2 years ago

please also address the formatting and clippy issues

Sorry for the long reply, thanks

9prady9 commented 2 years ago

please also address the formatting and clippy issues

Sorry for the long reply, thanks

I am not sure which long reply you are talking about. I was referring to the commit message "0517". What does that mean ? Can you put some readable text in the commit message.

peamaeq commented 2 years ago

please also address the formatting and clippy issues

Sorry for the long reply, thanks

I am not sure which long reply you are talking about. I was referring to the commit message "0517". What does that mean ? Can you put some readable text in the commit message.

I'm so sorry🤦‍♂️, '0517' is date. I'm really no expert with unsafe but my understanding is that you should choose the scopes as small as possible and such that any code outside of the unsafe block can't use it's results to cause havoc. Then people only have to look at these small unsafe blocks and as long as they consider them "safe" the whole code should be safe.