We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f998a62 commit ad856bdCopy full SHA for ad856bd
1 file changed
src/dimension/dimension_trait.rs
@@ -540,6 +540,14 @@ impl Dimension for Dim<[Ix; 1]> {
540
fn try_remove_axis(&self, axis: Axis) -> Self::Smaller {
541
self.remove_axis(axis)
542
}
543
+
544
+ fn from_dimension<D2: Dimension>(d: &D2) -> Option<Self> {
545
+ if 1 == d.ndim() {
546
+ Some(Ix1(d[0]))
547
+ } else {
548
+ None
549
+ }
550
551
private_impl! {}
552
553
0 commit comments