Skip to content

Commit 9f4e8f5

Browse files
committed
Fix lifetime warnings and fix and add a type hint for RA
1 parent 812c83a commit 9f4e8f5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/arrayvec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
637637
/// assert_eq!(&v1[..], &[3]);
638638
/// assert_eq!(&v2[..], &[1, 2]);
639639
/// ```
640-
pub fn drain<R>(&mut self, range: R) -> Drain<T, CAP>
640+
pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, CAP>
641641
where R: RangeBounds<usize>
642642
{
643643
// Memory safety
@@ -664,7 +664,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
664664
self.drain_range(start, end)
665665
}
666666

667-
fn drain_range(&mut self, start: usize, end: usize) -> Drain<T, CAP>
667+
fn drain_range(&mut self, start: usize, end: usize) -> Drain<'_, T, CAP>
668668
{
669669
let len = self.len();
670670

@@ -1126,7 +1126,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
11261126
let mut guard = ScopeExitGuard {
11271127
value: &mut self.len,
11281128
data: len,
1129-
f: move |&len, self_len| {
1129+
f: move |&len, self_len: &mut &mut LenUint| {
11301130
**self_len = len as LenUint;
11311131
}
11321132
};

0 commit comments

Comments
 (0)