Visitar URL original
fix: export Ranked from the prelude (#1621) · rust-ndarray/ndarray@0745418 · GitHub
Skip to content

Commit 0745418

Browse files
fix: export Ranked from the prelude (#1621)
#1575 moved `ndim` off of `Dimension` and onto the new `Ranked` supertrait. Generic code with a `D: Dimension` bound still works, but calling `.ndim()` on a concrete dimension type now needs `Ranked` in scope, so this stopped compiling: ```rust use ndarray::prelude::*; Ix2(3, 4).ndim(); // E0599: trait `Ranked` is not in scope ``` This exports `Ranked` from the prelude next to `Dimension`. Code that imports `ndarray::Dimension` directly, rather than going through the prelude, still has to import `ndarray::layout::ranked::Ranked` too. CI is red until #1622 lands. That PR fixes lints from newer toolchains that also fail on `refactor` itself. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 643181c commit 0745418

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/prelude.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub use crate::{
3535
#[doc(no_inline)]
3636
pub use crate::{Axis, Dim, Dimension};
3737

38+
#[doc(no_inline)]
39+
pub use crate::layout::ranked::Ranked;
40+
3841
#[doc(no_inline)]
3942
pub use crate::{ArrayRef0, ArrayRef1, ArrayRef2, ArrayRef3, ArrayRef4, ArrayRef5, ArrayRef6, ArrayRefD};
4043

0 commit comments

Comments
 (0)