示例
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