4 releases (2 stable)
Uses new Rust 2024
| 1.0.1 | Oct 9, 2025 |
|---|---|
| 0.1.2 | Oct 8, 2025 |
| 0.1.0 | Oct 8, 2025 |
#2162 in Algorithms
572 downloads per month
195KB
5K
SLoC
🥰 mycrush
mycrush is a pure Rust implementation of the CRUSH algorithm, converted from C with c2rust and then refactored for safety and WASM compatibility.
Features
- ✅ Pure Rust API - No C ABI compatibility layer
- ✅ WASM Compatible - Builds for
wasm32-unknown-unknowntarget - ✅ Safe Rust patterns - Uses Result types and safe abstractions where possible
- ✅ No symbol conflicts - Independent from the C libcrush library
- ✅ Modern error handling - CrushError enum instead of integer error codes
Building
# Regular build
cargo build --package mycrush
# WASM build
cargo build --package mycrush --target wasm32-unknown-unknown --release
# Run tests
cargo test --package mycrush
Status
The library has been successfully converted to a pure Rust implementation:
- All
#[unsafe(no_mangle)]andextern "C"declarations removed - Safe Rust implementations for helper functions
- WASM compatibility verified
- All tests passing
For detailed conversion notes, see PURE_RUST_CONVERSION.md.
Note
This library still uses some internal libc functions (malloc/free/memcpy/memset) but is WASM-compatible through the libc crate's WASM support. Future work will replace these with pure Rust alternatives.
Dependencies
~2.3–6.5MB
~124K SLoC