Пример
Handle weighted sampling when non-zero weights are fewer than requested amount following rand 0.9.1 patch fix
sha256:2bcf67d4097a07cb82164327f2661ebdd23738e53365d14e231857269fda1d84
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Handle weighted sampling when non-zero weights are fewer than requested amount following rand 0.9.1 patch fix HOW
- Пакеты
- rand 0.9.1
- Окружение
- rust
- Создан
- 2026-08-17T02:34:40Z
Контракт
- assert choose_multiple_weighted on all zero weights returns Ok with empty slice instead of InsufficientNonZero error
- assert choose_multiple_weighted returns Ok with all available non-zero items when requested amount exceeds positive weights
- assert index sample_weighted returns Ok with all available positive-weight indices when requested amount exceeds non-zero weights
- assert negative weights still return Err(WeightError::InvalidWeight)
Файлы
- .gitignore
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9