Skip to content

Commit ae984cb

Browse files
committed
Rename .value() to .into_inner()
1 parent 53bb078 commit ae984cb

17 files changed

Lines changed: 220 additions & 190 deletions

File tree

src/access.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ where <Self as Radium>::Item: BitRegister
7979
///
8080
/// [`BitMask`]: crate::index::BitMask
8181
fn clear_bits(&self, mask: BitMask<Self::Item>) {
82-
self.fetch_and(!mask.value(), atomic::Ordering::Relaxed);
82+
self.fetch_and(!mask.into_inner(), atomic::Ordering::Relaxed);
8383
}
8484

8585
/// Sets any number of bits in a memory register to `1`.
@@ -101,7 +101,7 @@ where <Self as Radium>::Item: BitRegister
101101
/// cleared. All bits in `*self` that are not selected (cleared to `0` in
102102
/// the `mask`) are unchanged.
103103
fn set_bits(&self, mask: BitMask<Self::Item>) {
104-
self.fetch_or(mask.value(), atomic::Ordering::Relaxed);
104+
self.fetch_or(mask.into_inner(), atomic::Ordering::Relaxed);
105105
}
106106

107107
/// Inverts any number of bits in a memory register.
@@ -123,7 +123,7 @@ where <Self as Radium>::Item: BitRegister
123123
/// inverted. All bits in `*self` that are not selected (cleared to `0` in
124124
/// the `mask`) are unchanged.
125125
fn invert_bits(&self, mask: BitMask<Self::Item>) {
126-
self.fetch_xor(mask.value(), atomic::Ordering::Relaxed);
126+
self.fetch_xor(mask.into_inner(), atomic::Ordering::Relaxed);
127127
}
128128

129129
/// Writes a value to one bit in a memory register.
@@ -147,13 +147,13 @@ where <Self as Radium>::Item: BitRegister
147147
where O: BitOrder {
148148
if value {
149149
self.fetch_or(
150-
index.select::<O>().value(),
150+
index.select::<O>().into_inner(),
151151
atomic::Ordering::Relaxed,
152152
);
153153
}
154154
else {
155155
self.fetch_and(
156-
!index.select::<O>().value(),
156+
!index.select::<O>().into_inner(),
157157
atomic::Ordering::Relaxed,
158158
);
159159
}

src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ where
202202
/// ```
203203
#[inline(always)]
204204
#[cfg(not(tarpaulin_include))]
205-
pub fn value(self) -> V {
205+
pub fn into_inner(self) -> V {
206206
self.data
207207
}
208208

src/array/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn create_arrays() {
3131
fn wrap_unwrap() {
3232
let data: [u8; 15] = *b"Saluton, mondo!";
3333
let bits = BitArray::<LocalBits, _>::new(data);
34-
assert_eq!(bits.value(), data);
34+
assert_eq!(bits.into_inner(), data);
3535
}
3636

3737
#[test]

src/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ where
435435
pub fn set_uninitialized(&mut self, value: bool) {
436436
let mut bp = self.bitspan;
437437
let (_, head, bits) = bp.raw_parts();
438-
let head = head.value() as usize;
438+
let head = head.into_inner() as usize;
439439
let tail = head + bits;
440440
let full = crate::mem::elts::<T::Mem>(tail) * T::Mem::BITS as usize;
441441
unsafe {

src/domain.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ macro_rules! bit_domain {
232232
let (e, t) = h.span(bitspan.len());
233233
let w = T::Mem::BITS as u8;
234234

235-
match (h.value(), e, t.value()) {
235+
match (h.into_inner(), e, t.into_inner()) {
236236
(_, 0, _) => Self::empty(),
237237
(0, _, t) if t == w => Self::spanning(slice),
238238
(_, _, t) if t == w => Self::partial_head(slice, h),
@@ -257,11 +257,11 @@ macro_rules! bit_domain {
257257
) -> Self {
258258
let (head, rest) = bit_domain!(split $($m)?
259259
slice,
260-
(T::Mem::BITS as u8 - head.value()) as usize,
260+
(T::Mem::BITS as u8 - head.into_inner()) as usize,
261261
);
262262
let (body, tail) = bit_domain!(split $($m)?
263263
rest,
264-
rest.len() - (tail.value() as usize),
264+
rest.len() - (tail.into_inner() as usize),
265265
);
266266
Self::Region {
267267
head: bit_domain!(retype $($m)? head),
@@ -288,7 +288,7 @@ macro_rules! bit_domain {
288288
) -> Self {
289289
let (head, rest) = bit_domain!(split $($m)?
290290
slice,
291-
(T::Mem::BITS as u8 - head.value()) as usize,
291+
(T::Mem::BITS as u8 - head.into_inner()) as usize,
292292
);
293293
let (head, body) = (
294294
bit_domain!(retype $($m)? head),
@@ -313,7 +313,7 @@ macro_rules! bit_domain {
313313
) -> Self {
314314
let (rest, tail) = bit_domain!(split $($m)?
315315
slice,
316-
slice.len() - (tail.value() as usize),
316+
slice.len() - (tail.into_inner() as usize),
317317
);
318318
let (body, tail) = (
319319
bit_domain!(retype $($m)? rest),
@@ -538,7 +538,7 @@ macro_rules! domain {
538538
let tail = bitspan.tail();
539539
let bits = T::Mem::BITS as u8;
540540
let base = bitspan.address().to_const() as *const _;
541-
match (head.value(), elts, tail.value()) {
541+
match (head.into_inner(), elts, tail.into_inner()) {
542542
(_, 0, _) => Self::empty(),
543543
(0, _, t) if t == bits => Self::spanning(base, elts),
544544
(_, _, t) if t == bits => Self::partial_head(base, elts, head),

0 commit comments

Comments
 (0)