TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
Use Inclusive Ranges for PRNGs
2 点
作者
chilipepperhott
大约 1 个月前
1 comment
TrayKnots
大约 1 个月前
Interesting point. But I usually prefer `(lower..upper).choose()`. So, if I want it inclusive, I can simply do `(lower..=upper).choose()`. No downcasting required. And perfectly obvious behaviour thanks to a known API.