@@ -16,7 +16,9 @@ use std::ptr::NonNull;
16
16
use alloc:: sync:: Arc ;
17
17
use alloc:: vec:: Vec ;
18
18
19
- use crate :: { ArrayBase , CowRepr , Dimension , OwnedArcRepr , OwnedRepr , RawViewRepr , ViewRepr } ;
19
+ use crate :: {
20
+ ArcArray , Array , ArrayBase , CowRepr , Dimension , OwnedArcRepr , OwnedRepr , RawViewRepr , ViewRepr ,
21
+ } ;
20
22
21
23
/// Array representation trait.
22
24
///
@@ -104,7 +106,7 @@ pub unsafe trait Data: RawData {
104
106
/// Converts the array to a uniquely owned array, cloning elements if necessary.
105
107
#[ doc( hidden) ]
106
108
#[ allow( clippy:: wrong_self_convention) ]
107
- fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
109
+ fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> Array < Self :: Elem , D >
108
110
where
109
111
Self :: Elem : Clone ,
110
112
D : Dimension ;
@@ -114,15 +116,15 @@ pub unsafe trait Data: RawData {
114
116
#[ doc( hidden) ]
115
117
fn try_into_owned_nocopy < D > (
116
118
self_ : ArrayBase < Self , D > ,
117
- ) -> Result < ArrayBase < OwnedRepr < Self :: Elem > , D > , ArrayBase < Self , D > >
119
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
118
120
where
119
121
D : Dimension ;
120
122
121
123
/// Return a shared ownership (copy on write) array based on the existing one,
122
124
/// cloning elements if necessary.
123
125
#[ doc( hidden) ]
124
126
#[ allow( clippy:: wrong_self_convention) ]
125
- fn to_shared < D > ( self_ : & ArrayBase < Self , D > ) -> ArrayBase < OwnedArcRepr < Self :: Elem > , D >
127
+ fn to_shared < D > ( self_ : & ArrayBase < Self , D > ) -> ArcArray < Self :: Elem , D >
126
128
where
127
129
Self :: Elem : Clone ,
128
130
D : Dimension ,
@@ -271,7 +273,7 @@ where
271
273
}
272
274
273
275
unsafe impl < A > Data for OwnedArcRepr < A > {
274
- fn into_owned < D > ( mut self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
276
+ fn into_owned < D > ( mut self_ : ArrayBase < Self , D > ) -> Array < Self :: Elem , D >
275
277
where
276
278
A : Clone ,
277
279
D : Dimension ,
@@ -287,7 +289,7 @@ unsafe impl<A> Data for OwnedArcRepr<A> {
287
289
288
290
fn try_into_owned_nocopy < D > (
289
291
self_ : ArrayBase < Self , D > ,
290
- ) -> Result < ArrayBase < OwnedRepr < Self :: Elem > , D > , ArrayBase < Self , D > >
292
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
291
293
where
292
294
D : Dimension ,
293
295
{
@@ -307,7 +309,7 @@ unsafe impl<A> Data for OwnedArcRepr<A> {
307
309
}
308
310
309
311
#[ allow( clippy:: wrong_self_convention) ]
310
- fn to_shared < D > ( self_ : & ArrayBase < Self , D > ) -> ArrayBase < OwnedArcRepr < Self :: Elem > , D >
312
+ fn to_shared < D > ( self_ : & ArrayBase < Self , D > ) -> ArcArray < Self :: Elem , D >
311
313
where
312
314
Self :: Elem : Clone ,
313
315
D : Dimension ,
@@ -360,7 +362,7 @@ unsafe impl<A> RawDataMut for OwnedRepr<A> {
360
362
361
363
unsafe impl < A > Data for OwnedRepr < A > {
362
364
#[ inline]
363
- fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
365
+ fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> Array < Self :: Elem , D >
364
366
where
365
367
A : Clone ,
366
368
D : Dimension ,
@@ -371,7 +373,7 @@ unsafe impl<A> Data for OwnedRepr<A> {
371
373
#[ inline]
372
374
fn try_into_owned_nocopy < D > (
373
375
self_ : ArrayBase < Self , D > ,
374
- ) -> Result < ArrayBase < Self , D > , ArrayBase < Self , D > >
376
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
375
377
where
376
378
D : Dimension ,
377
379
{
@@ -426,7 +428,7 @@ unsafe impl<'a, A> RawData for ViewRepr<&'a A> {
426
428
}
427
429
428
430
unsafe impl < ' a , A > Data for ViewRepr < & ' a A > {
429
- fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
431
+ fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> Array < Self :: Elem , D >
430
432
where
431
433
Self :: Elem : Clone ,
432
434
D : Dimension ,
@@ -436,7 +438,7 @@ unsafe impl<'a, A> Data for ViewRepr<&'a A> {
436
438
437
439
fn try_into_owned_nocopy < D > (
438
440
self_ : ArrayBase < Self , D > ,
439
- ) -> Result < ArrayBase < OwnedRepr < Self :: Elem > , D > , ArrayBase < Self , D > >
441
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
440
442
where
441
443
D : Dimension ,
442
444
{
@@ -480,7 +482,7 @@ unsafe impl<'a, A> RawDataMut for ViewRepr<&'a mut A> {
480
482
}
481
483
482
484
unsafe impl < ' a , A > Data for ViewRepr < & ' a mut A > {
483
- fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
485
+ fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> Array < Self :: Elem , D >
484
486
where
485
487
Self :: Elem : Clone ,
486
488
D : Dimension ,
@@ -490,7 +492,7 @@ unsafe impl<'a, A> Data for ViewRepr<&'a mut A> {
490
492
491
493
fn try_into_owned_nocopy < D > (
492
494
self_ : ArrayBase < Self , D > ,
493
- ) -> Result < ArrayBase < OwnedRepr < Self :: Elem > , D > , ArrayBase < Self , D > >
495
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
494
496
where
495
497
D : Dimension ,
496
498
{
@@ -653,7 +655,7 @@ where
653
655
654
656
unsafe impl < ' a , A > Data for CowRepr < ' a , A > {
655
657
#[ inline]
656
- fn into_owned < D > ( self_ : ArrayBase < CowRepr < ' a , A > , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
658
+ fn into_owned < D > ( self_ : ArrayBase < CowRepr < ' a , A > , D > ) -> Array < Self :: Elem , D >
657
659
where
658
660
A : Clone ,
659
661
D : Dimension ,
@@ -670,7 +672,7 @@ unsafe impl<'a, A> Data for CowRepr<'a, A> {
670
672
671
673
fn try_into_owned_nocopy < D > (
672
674
self_ : ArrayBase < Self , D > ,
673
- ) -> Result < ArrayBase < OwnedRepr < Self :: Elem > , D > , ArrayBase < Self , D > >
675
+ ) -> Result < Array < Self :: Elem , D > , ArrayBase < Self , D > >
674
676
where
675
677
D : Dimension ,
676
678
{
0 commit comments