Skip to content

Commit 335c89c

Browse files
committed
Bump version, closes #154
1 parent 3aaf263 commit 335c89c

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* **`1.2.1`**
2+
* Replace `doc_auto_cfg` with `doc_cfg` [#155](https://github.com/fizyk20/generic-array/pull/155)
3+
14
* **`1.2.0`**
25
* Mark more functions as `const`
36
* Bump MSRV to 1.83.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "generic-array"
4-
version = "1.2.0"
4+
version = "1.2.1"
55
authors = ["Bartłomiej Kamiński <fizyk20@gmail.com>", "Aaron Trent <novacrazy@gmail.com>"]
66
edition = "2021"
77
rust-version = "1.83"

src/arr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// # NOTES AND LIMITATIONS
2020
/// * As of `generic-array 1.0`, [`From`]/[`from_array`](crate::GenericArray::from_array) can be used directly for a wide range of regular arrays.
2121
/// * The `[T; N: ArrayLength]` and `[T; usize]` explicit forms are limited to `Copy` values. Use
22-
/// [`GenericArray::generate(|| value.clone())`](crate::GenericSequence::generate) for non-`Copy` items.
22+
/// [`GenericArray::generate(|| value.clone())`](crate::GenericSequence::generate) for non-`Copy` items.
2323
/// * The `[T; usize]` explicit and `[0, 1, 2, 3]` implicit forms are limited to lengths supported by [`Const<U>`](typenum::Const)
2424
#[macro_export]
2525
macro_rules! arr {

src/internal.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ impl<T, N: ArrayLength> ArrayBuilder<T, N> {
7474
/// # }
7575
/// ```
7676
#[inline(always)]
77-
pub unsafe fn iter_position(&mut self) -> (slice::IterMut<MaybeUninit<T>>, &mut usize) {
77+
pub unsafe fn iter_position(
78+
&'_ mut self,
79+
) -> (slice::IterMut<'_, MaybeUninit<T>>, &'_ mut usize) {
7880
(self.array.iter_mut(), &mut self.position)
7981
}
8082

@@ -164,7 +166,9 @@ impl<'a, T, N: ArrayLength> IntrusiveArrayBuilder<'a, T, N> {
164166
/// # }
165167
/// ```
166168
#[inline(always)]
167-
pub unsafe fn iter_position(&mut self) -> (slice::IterMut<MaybeUninit<T>>, &mut usize) {
169+
pub unsafe fn iter_position(
170+
&'_ mut self,
171+
) -> (slice::IterMut<'_, MaybeUninit<T>>, &'_ mut usize) {
168172
(self.array.iter_mut(), &mut self.position)
169173
}
170174

@@ -219,7 +223,7 @@ impl<T, N: ArrayLength> ArrayConsumer<T, N> {
219223
///
220224
/// You MUST increment the position as you iterate to mark off consumed elements.
221225
#[inline(always)]
222-
pub unsafe fn iter_position(&mut self) -> (slice::Iter<T>, &mut usize) {
226+
pub unsafe fn iter_position(&'_ mut self) -> (slice::Iter<'_, T>, &'_ mut usize) {
223227
(self.array.iter(), &mut self.position)
224228
}
225229
}

tests/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ fn test_into_iter_drops() {
153153
}
154154
}
155155

156-
fn r(i: &Cell<usize>) -> R {
156+
fn r(i: &'_ Cell<usize>) -> R<'_> {
157157
R { i }
158158
}
159159

160-
fn v(i: &Cell<usize>) -> GenericArray<R, U5> {
160+
fn v(i: &'_ Cell<usize>) -> GenericArray<R<'_>, U5> {
161161
arr![r(i), r(i), r(i), r(i), r(i)]
162162
}
163163

0 commit comments

Comments
 (0)