1313//! to view a `[[i32; 6]; 5]` as a `&[[[i32; 3]; 2]; 5]`,
1414//! one could write
1515//!
16- //! ```
17- //! # // FIXME: Dumb/confusing example. I actually wrote it wrong
18- //! # // the first time, calling `flat()` twice because it
19- //! # // didn't occur to me that the outer '; 5' is already
20- //! # // automatically eliminated by coercion.
21- //! # //
22- //! # // Almost makes a case for providing `.as_slice()`
23- //! # // as an explicit form of this coercion.
24- //! #
25- //! # use cv_convert::prelude::*;
26- //! # let _ = || {
27- //! # let x: [[i32; 6]; 5] = unimplemented!();
28- //! # let _: &[[[i32; 3]; 2]; 5] =
29- //! x.flat().nest().nest().as_array_ref()
30- //! # ;
31- //! # };
16+ //! ```rust,ignore
17+ //! // FIXME: Dumb/confusing example. I actually wrote it wrong
18+ //! // the first time, calling `flat()` twice because it
19+ //! // didn't occur to me that the outer '; 5' is already
20+ //! // automatically eliminated by coercion.
21+ //! //
22+ //! // Almost makes a case for providing `.as_slice()`
23+ //! // as an explicit form of this coercion.
24+ //!
25+ //! use cv_convert::prelude::*;
26+ //! let _ = || {
27+ //! let x: [[i32; 6]; 5] = unimplemented!();
28+ //! let _: &[[[i32; 3]; 2]; 5] = x.flat().nest().nest().as_array_ref();
29+ //! };
3230//! ```
3331//!
3432//! Type inference generally works quite well, and as long as the
3836//! In cases where type inference is unable to determine the target
3937//! array size, one can use a turbofish: e.g .`x.nest::<[_; 3]>()`.
4038//!
41- //! ```
39+ //! ```rust,ignore
4240//! use ::cv_convert::prelude::*;
4341//!
4442//! let vec = vec![[2i32, 2, 2], [7, 7, 7], [4, 4, 4], [1, 1, 1]];
6159//! convert between such types, you can use these traits in tandem
6260//! with `<[T]>::to_vec` to perform a copy:
6361//!
64- //! ```
65- //! # use ::cv_convert::prelude::*;
62+ //! ```rust,ignore
63+ //! use ::cv_convert::prelude::*;
6664//! let vec = vec![[2i32, 2, 2], [7, 7, 7]];
6765//!
6866//! // copying into a Vec<i32>
@@ -82,7 +80,7 @@ pub mod prelude {
8280 //! It is meant to be glob imported, by users who may find it obnoxious to remember
8381 //! the precise names of the traits that each method belongs to.
8482 //!
85- //! ```rust
83+ //! ```rust,ignore
8684 //! use cv_convert::prelude::*;
8785 //! ```
8886 //!
0 commit comments