Skip to content

Commit 5df12b1

Browse files
committed
Rename Slice::choices() -> Slice::num_choices()
Signed-off-by: Justus Fluegel <[email protected]>
1 parent ebeaeb3 commit 5df12b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).
99
You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.
1010

1111
## [0.9.1] - unreleased
12-
- Add the `Slice::choices` method to the Slice distribution (#1402)
12+
- Add the `Slice::num_choices` method to the Slice distribution (#1402)
1313

1414
## [0.9.0-alpha.0] - 2024-02-18
1515
This is a pre-release. To depend on this version, use `rand = "=0.9.0-alpha.0"` to prevent automatic updates (which can be expected to include breaking changes).

src/distributions/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'a, T> Slice<'a, T> {
8585
}
8686

8787
/// Returns the count of choices in this distribution
88-
pub fn choices(&self) -> NonZeroUsize {
88+
pub fn num_choices(&self) -> NonZeroUsize {
8989
// Safety: at construction time, it was ensured that the slice was
9090
// non-empty, as such the length can never be 0.
9191
unsafe { NonZeroUsize::new_unchecked(self.slice.len()) }

0 commit comments

Comments
 (0)