indigits / scirust

Scientific Computing Library in Rust
Apache License 2.0
265 stars 29 forks source link

Unwrap the result from Option whenever possible #18

Closed achanda closed 9 years ago

achanda commented 9 years ago

Use of usafe code should be avoided as much as possible

daniel-vainsencher commented 9 years ago

As mentioned elsewhere, I prefer to simply make get panic on out of bounds. Then the code using it remains clean and readable. Out of bounds is always a bug and should panic.

On Tue, Aug 4, 2015 at 3:13 PM, Abhishek Chanda notifications@github.com wrote:

Use of usafe code should be avoided as much as possible

You can view, comment on, or merge this pull request online at:

https://github.com/indigits/scirust/pull/18 Commit Summary

  • Unwrap the result from Option whenever possible

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/indigits/scirust/pull/18.

Daniel Vainsencher

shailesh1729 commented 9 years ago

Shape::get() needs to be updated separately to return T and panic()! internally.