File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,8 +275,8 @@ where D: Dimension
275275{
276276 /// Convert into a read-only view.
277277 ///
278- /// Unlike [`Self::view`], this method consumes the mutable view and preserves
279- /// the original lifetime of the data.
278+ /// This method consumes the mutable view and returns an `ArrayView` that
279+ /// preserves the original lifetime `'a` of the data.
280280 pub fn into_view ( self ) -> ArrayView < ' a , A , D >
281281 {
282282 unsafe { ArrayView :: new ( self . parts . ptr , self . parts . dim , self . parts . strides ) }
Original file line number Diff line number Diff line change @@ -33,16 +33,20 @@ fn test_view_conversion()
3333fn test_view_conversion_lifetime ( )
3434{
3535 // Regression test for #1595
36- struct Foo < ' a > {
36+ struct Foo < ' a >
37+ {
3738 data : ArrayViewMut2 < ' a , f32 > ,
3839 }
3940
40- impl < ' a > Foo < ' a > {
41- fn into_shared ( self ) -> ArrayView2 < ' a , f32 > {
41+ impl < ' a > Foo < ' a >
42+ {
43+ fn into_shared ( self ) -> ArrayView2 < ' a , f32 >
44+ {
4245 self . data . into_view ( )
4346 }
4447
45- fn into_shared_from ( self ) -> ArrayView2 < ' a , f32 > {
48+ fn into_shared_from ( self ) -> ArrayView2 < ' a , f32 >
49+ {
4650 self . data . into ( )
4751 }
4852 }
You can’t perform that action at this time.
0 commit comments