Skip to content

Commit 192a166

Browse files
committed
FIX: Make is_contiguous pub(crate)
The reason this method is not yet public, is that it's not accurate (false negatives) for less common layouts. It's correct for C/F i.e row/col major layouts.
1 parent 511f8b2 commit 192a166

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/impl_methods.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,11 @@ where
12931293
is_standard_layout(&self.dim, &self.strides)
12941294
}
12951295

1296-
fn is_contiguous(&self) -> bool {
1296+
/// Return true if the array is known to be contiguous.
1297+
///
1298+
/// Will detect c- and f-contig arrays correctly, but otherwise
1299+
/// There are some false negatives.
1300+
pub(crate) fn is_contiguous(&self) -> bool {
12971301
D::is_contiguous(&self.dim, &self.strides)
12981302
}
12991303

0 commit comments

Comments
 (0)