Skip to content

Commit ac99323

Browse files
committed
address nits on new tests
1 parent 06dfc06 commit ac99323

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/array.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,6 @@ fn owned_array_discontiguous_drop() {
836836
use ::std::collections::BTreeSet;
837837

838838
struct InsertOnDrop<T: Ord>(Rc<RefCell<BTreeSet<T>>>, Option<T>);
839-
impl<T: Ord> InsertOnDrop<T> {
840-
fn new(set: Rc<RefCell<BTreeSet<T>>>, value: T) -> Self {
841-
InsertOnDrop(set, Some(value))
842-
}
843-
}
844839
impl<T: Ord> Drop for InsertOnDrop<T> {
845840
fn drop(&mut self) {
846841
let InsertOnDrop(ref set, ref mut value) = *self;
@@ -850,12 +845,12 @@ fn owned_array_discontiguous_drop() {
850845

851846
let set = Rc::new(RefCell::new(BTreeSet::new()));
852847
{
853-
let v: Vec<_> = (0..12).map(|x| InsertOnDrop::new(set.clone(), x)).collect();
848+
let v: Vec<_> = (0..12).map(|x| InsertOnDrop(set.clone(), Some(x))).collect();
854849
let mut a = Array::from_shape_vec((2, 6), v).unwrap();
855850
// discontiguous and non-zero offset
856851
a.slice_inplace(s![.., 1..]);
857852
}
858-
// each item was dropped
853+
// each item was dropped exactly once
859854
itertools::assert_equal(set.borrow().iter().cloned(), 0..12);
860855
}
861856

@@ -1433,8 +1428,7 @@ fn discontiguous_owned_to_owned() {
14331428
let co = c.to_owned();
14341429
assert_eq!(c.strides(), &[3, 2]);
14351430
assert_eq!(co.strides(), &[2, 1]);
1436-
assert_eq!(c.shape(), co.shape());
1437-
itertools::assert_equal(c.iter(), co.iter());
1431+
assert_eq!(c, co);
14381432
}
14391433

14401434
#[test]

0 commit comments

Comments
 (0)