Skip to content

Commit 5414f1d

Browse files
authored
Move lifetime of take_iter from iterator to its items (#6403)
1 parent aad55d5 commit 5414f1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arrow-array/src/array/binary_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize> {
8484
pub fn take_iter<'a>(
8585
&'a self,
8686
indexes: impl Iterator<Item = Option<usize>> + 'a,
87-
) -> impl Iterator<Item = Option<&[u8]>> + 'a {
87+
) -> impl Iterator<Item = Option<&'a [u8]>> {
8888
indexes.map(|opt_index| opt_index.map(|index| self.value(index)))
8989
}
9090

@@ -95,7 +95,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize> {
9595
pub unsafe fn take_iter_unchecked<'a>(
9696
&'a self,
9797
indexes: impl Iterator<Item = Option<usize>> + 'a,
98-
) -> impl Iterator<Item = Option<&[u8]>> + 'a {
98+
) -> impl Iterator<Item = Option<&'a [u8]>> {
9999
indexes.map(|opt_index| opt_index.map(|index| self.value_unchecked(index)))
100100
}
101101
}

arrow-array/src/array/string_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize> {
4242
pub fn take_iter<'a>(
4343
&'a self,
4444
indexes: impl Iterator<Item = Option<usize>> + 'a,
45-
) -> impl Iterator<Item = Option<&str>> + 'a {
45+
) -> impl Iterator<Item = Option<&'a str>> {
4646
indexes.map(|opt_index| opt_index.map(|index| self.value(index)))
4747
}
4848

@@ -53,7 +53,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize> {
5353
pub unsafe fn take_iter_unchecked<'a>(
5454
&'a self,
5555
indexes: impl Iterator<Item = Option<usize>> + 'a,
56-
) -> impl Iterator<Item = Option<&str>> + 'a {
56+
) -> impl Iterator<Item = Option<&'a str>> {
5757
indexes.map(|opt_index| opt_index.map(|index| self.value_unchecked(index)))
5858
}
5959

0 commit comments

Comments
 (0)