Skip to content

Commit

Permalink
Suggest use try_from_bisector over from_bisector
Browse files Browse the repository at this point in the history
  • Loading branch information
foresterre committed May 25, 2022
1 parent 38b42a0 commit 3b9bf5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ impl Indices {
///
/// NB: The slice given to [`Bisector`] **must not be empty**.
///
/// Consider using the fallible function [`Indices::try_from_bisector`] when possible.
///
/// ### Undefined behaviour
///
/// If the slice given to [`Bisector`] is empty, the resulting behaviour may not be as expected.
Expand All @@ -216,6 +218,7 @@ impl Indices {
/// set to the `right` index will underflow, resulting in undefined behaviour.
///
/// [`Bisector`]: crate::Bisector
/// [`Indices::try_from_bisector`]: crate::Indices::try_from_bisector
pub fn from_bisector<T>(bisector: &Bisector<T>) -> Self {
Self {
left: 0,
Expand Down

0 comments on commit 3b9bf5f

Please sign in to comment.