Skip to content

Commit

Permalink
Avoid deprecated methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3vu0r committed Feb 22, 2025
1 parent 20b1b19 commit 92cf34c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
)]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(miri, feature(strict_provenance), feature(maybe_uninit_slice))]
#![cfg_attr(miri, feature(maybe_uninit_slice))]

#[inline(always)]
fn maybe_grow<R, F: FnOnce() -> R>(callback: F) -> R {
Expand Down Expand Up @@ -1381,9 +1381,10 @@ where
/// let mut s = array![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
/// let num = 42;
/// let idx = s.partition_point(|&x| x < num);
/// let mut s = s.into_raw_vec();
/// s.insert(idx, num);
/// assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
/// let (mut s, off) = s.into_raw_vec_and_offset();
/// let off = off.unwrap_or_default();
/// s.insert(off + idx, num);
/// assert_eq!(s[off..], [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
/// ```
#[must_use]
fn partition_point<P>(&self, pred: P) -> usize
Expand Down Expand Up @@ -1500,9 +1501,10 @@ where
/// let num = 42;
/// let idx = s.partition_point(|&x| x < num);
/// // The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
/// let mut s = s.into_raw_vec();
/// s.insert(idx, num);
/// assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
/// let (mut s, off) = s.into_raw_vec_and_offset();
/// let off = off.unwrap_or_default();
/// s.insert(off + idx, num);
/// assert_eq!(s[off..], [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
/// ```
fn binary_search(&self, x: &A) -> Result<usize, usize>
where
Expand Down

0 comments on commit 92cf34c

Please sign in to comment.