@@ -1893,9 +1893,8 @@ impl<T, A: Allocator> VecDeque<T, A> {
18931893 // are valid ranges into the physical buffer, so
18941894 // it's ok to pass them to `buffer_range` and
18951895 // dereference the result.
1896- let a = unsafe { & * self . buffer_range ( a_range) } ;
1897- // SAFETY: As above.
1898- let b = unsafe { & * self . buffer_range ( b_range) } ;
1896+ let ( a, b) = unsafe { ( & * self . buffer_range ( a_range) , & * self . buffer_range ( b_range) ) } ;
1897+
18991898 Iter :: new ( a. iter ( ) , b. iter ( ) )
19001899 }
19011900
@@ -1930,13 +1929,13 @@ impl<T, A: Allocator> VecDeque<T, A> {
19301929 R : RangeBounds < usize > ,
19311930 {
19321931 let ( a_range, b_range) = self . slice_ranges ( range, self . len ) ;
1933- // SAFETY: The ranges returned by `slice_ranges`
1934- // are valid ranges into the physical buffer, so
1935- // it's ok to pass them to `buffer_range` and
1936- // dereference the result.
1937- let a = unsafe { & mut * self . buffer_range ( a_range ) } ;
1938- // SAFETY: As above.
1939- let b = unsafe { & mut * self . buffer_range ( b_range ) } ;
1932+ let ( a , b ) =
1933+ // SAFETY: The ranges returned by `slice_ranges`
1934+ // are valid ranges into the physical buffer, so
1935+ // it's ok to pass them to `buffer_range` and
1936+ // dereference the result.
1937+ unsafe { ( & mut * self . buffer_range ( a_range ) , & mut * self . buffer_range ( b_range ) ) } ;
1938+
19401939 IterMut :: new ( a. iter_mut ( ) , b. iter_mut ( ) )
19411940 }
19421941
0 commit comments