Skip to content

Commit f97361a

Browse files
committed
Fix cargo fmt being unhappy with changes to Deque::retain_back
1 parent 04ab39e commit f97361a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/deque.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,9 @@ impl<T, S: VecStorage<T> + ?Sized> DequeInner<T, S> {
991991
let (front, back) = self.as_mut_slices();
992992

993993
if len > back.len() {
994-
// The `back` slice remains unchanged (`len` intends to retain more elements than `back` contains),
995-
// front.len() + back.len() == self.len, so `end` is non-negative and end <= front.len().
994+
// The `back` slice remains unchanged (`len` intends to retain more elements than `back`
995+
// contains), front.len() + back.len() == self.len, so `end` is non-negative
996+
// and end <= front.len().
996997
let end = front.len() - (len - back.len());
997998

998999
// Safety: `end` is always less than or equal to `front.len()`
@@ -1006,8 +1007,8 @@ impl<T, S: VecStorage<T> + ?Sized> DequeInner<T, S> {
10061007
// Safety: Any slice passed to `drop_in_place` is valid:
10071008
// * Only valid elements previously contained within `front` are present.
10081009
// * The elements are valid for reading/writing, originating from a &mut [T].
1009-
// * Deque front cursor is moved before calling `drop_in_place`, so no value is
1010-
// dropped twice if `drop_in_place` panics.
1010+
// * Deque front cursor is moved before calling `drop_in_place`, so no value is dropped
1011+
// twice if `drop_in_place` panics.
10111012
unsafe { ptr::drop_in_place(drop_front) }
10121013
} else {
10131014
/// Runs the destructor for all items in the slice when it gets dropped
@@ -1039,11 +1040,10 @@ impl<T, S: VecStorage<T> + ?Sized> DequeInner<T, S> {
10391040
self.full = false;
10401041

10411042
// Safety:
1042-
// * If `drop_front` causes a panic, the Dropper will still be called to drop its
1043-
// slice during unwinding. In either case, front will always be
1044-
// dropped before back.
1045-
// * Deque front cursor is moved before calling `drop_in_place`, so no value is
1046-
// dropped twice if either `drop_in_place` panics.
1043+
// * If `drop_front` causes a panic, the Dropper will still be called to drop its slice
1044+
// during unwinding. In either case, front will always be dropped before back.
1045+
// * Deque front cursor is moved before calling `drop_in_place`, so no value is dropped
1046+
// twice if either `drop_in_place` panics.
10471047
unsafe {
10481048
let _back_dropper = Dropper(&mut *drop_back);
10491049
ptr::drop_in_place(drop_front);

0 commit comments

Comments
 (0)