Renamed isolate_most_least_significant_one functions

libs-api has agreed to rename these functions to
`isolate_highest_one`/`isolate_lowest_one`
This commit is contained in:
okaneco 2025-08-05 16:37:04 -04:00
parent 213d946a38
commit eee6f804a9
6 changed files with 38 additions and 38 deletions

View file

@ -177,14 +177,14 @@ macro_rules! int_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_most_significant_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_most_significant_one(), 0);")]
/// assert_eq!(n.isolate_highest_one(), 0b_01000000);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_highest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_most_significant_one(self) -> Self {
pub const fn isolate_highest_one(self) -> Self {
self & (((1 as $SelfT) << (<$SelfT>::BITS - 1)).wrapping_shr(self.leading_zeros()))
}
@ -198,14 +198,14 @@ macro_rules! int_impl {
///
#[doc = concat!("let n: ", stringify!($SelfT), " = 0b_01100100;")]
///
/// assert_eq!(n.isolate_least_significant_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_least_significant_one(), 0);")]
/// assert_eq!(n.isolate_lowest_one(), 0b_00000100);
#[doc = concat!("assert_eq!(0_", stringify!($SelfT), ".isolate_lowest_one(), 0);")]
/// ```
#[unstable(feature = "isolate_most_least_significant_one", issue = "136909")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
pub const fn isolate_least_significant_one(self) -> Self {
pub const fn isolate_lowest_one(self) -> Self {
self & self.wrapping_neg()
}