JakubValtar / basisu_rs

A Rust implementation of Basis Universal transcoder
Apache License 2.0
17 stars 1 forks source link

Remove all unsafe code #2

Closed fintelia closed 1 year ago

fintelia commented 1 year ago

This makes BC7_MODE_5_OPTIMAL_ENDPOINTS and BC7_MODE_6_OPTIMAL_ENDPOINTS constants. Their contents are validated by a new unit test which compares their contents to the result from calculate_mode_8_bc7_tables.

It also adds #![forbid(unsafe_code)] to the crate root to prevent accidental re-introduction of unsafe code.

JakubValtar commented 1 year ago

Thanks! It's nice that the unsafe is gone and the precomputed tables mean we don't need to calucte them on the first use.