@@ -56,7 +56,7 @@ pub trait ArrayOps<T, const N: usize>:
56
56
/// [`ArraySize`] type: `typenum`-provided [`Unsigned`] integer.
57
57
///
58
58
/// Not to be confused with [`ArrayOps::SIZE`], which is a `usize`.
59
- type Size : ArraySize < T > ;
59
+ type Size : ArraySize ;
60
60
61
61
/// Returns a reference to the inner array.
62
62
fn as_array_ref ( & self ) -> & [ T ; N ] ;
@@ -106,15 +106,15 @@ pub trait ArrayOps<T, const N: usize>:
106
106
107
107
/// Trait which associates a [`usize`] size and `ArrayType` with a
108
108
/// `typenum`-provided [`Unsigned`] integer.
109
- pub trait ArraySize < T > : Unsigned {
109
+ pub trait ArraySize : Unsigned {
110
110
/// Array type which corresponds to this size.
111
- type ArrayType : AsRef < [ T ] > + AsMut < [ T ] > + IntoArray < T > + Sized ;
111
+ type ArrayType < T > : AsRef < [ T ] > + AsMut < [ T ] > + IntoArray < T > + Sized ;
112
112
}
113
113
114
114
/// Convert the given type into an [`Array`].
115
115
pub trait IntoArray < T > {
116
116
/// Size of the [`Array`].
117
- type Size : ArraySize < T > ;
117
+ type Size : ArraySize ;
118
118
119
119
/// Convert into the `hybrid-array` crate's [`Array`] type.
120
120
fn into_hybrid_array ( self ) -> Array < T , Self :: Size > ;
@@ -157,8 +157,8 @@ macro_rules! impl_array_size {
157
157
}
158
158
}
159
159
160
- impl < T > ArraySize < T > for typenum:: $ty {
161
- type ArrayType = [ T ; $len] ;
160
+ impl ArraySize for typenum:: $ty {
161
+ type ArrayType < T > = [ T ; $len] ;
162
162
}
163
163
164
164
impl <T > IntoArray <T > for [ T ; $len] {
@@ -290,11 +290,11 @@ impl_array_size! {
290
290
/// allowing interoperability and a transition path to const generics.
291
291
#[ derive( Copy , Clone , Debug , Eq , Hash , PartialEq , PartialOrd , Ord ) ]
292
292
#[ repr( transparent) ]
293
- pub struct Array < T , U : ArraySize < T > > ( pub U :: ArrayType ) ;
293
+ pub struct Array < T , U : ArraySize > ( pub U :: ArrayType < T > ) ;
294
294
295
295
impl < T , U > Array < T , U >
296
296
where
297
- U : ArraySize < T > ,
297
+ U : ArraySize ,
298
298
{
299
299
/// Returns a slice containing the entire array. Equivalent to `&s[..]`.
300
300
#[ inline]
@@ -312,7 +312,7 @@ where
312
312
impl < T , U , const N : usize > AsRef < [ T ; N ] > for Array < T , U >
313
313
where
314
314
Self : ArrayOps < T , N > ,
315
- U : ArraySize < T > ,
315
+ U : ArraySize ,
316
316
{
317
317
#[ inline]
318
318
fn as_ref ( & self ) -> & [ T ; N ] {
@@ -323,7 +323,7 @@ where
323
323
impl < T , U , const N : usize > AsMut < [ T ; N ] > for Array < T , U >
324
324
where
325
325
Self : ArrayOps < T , N > ,
326
- U : ArraySize < T > ,
326
+ U : ArraySize ,
327
327
{
328
328
#[ inline]
329
329
fn as_mut ( & mut self ) -> & mut [ T ; N ] {
@@ -334,7 +334,7 @@ where
334
334
impl < T , U , const N : usize > Borrow < [ T ; N ] > for Array < T , U >
335
335
where
336
336
Self : ArrayOps < T , N > ,
337
- U : ArraySize < T > ,
337
+ U : ArraySize ,
338
338
{
339
339
#[ inline]
340
340
fn borrow ( & self ) -> & [ T ; N ] {
@@ -345,7 +345,7 @@ where
345
345
impl < T , U , const N : usize > BorrowMut < [ T ; N ] > for Array < T , U >
346
346
where
347
347
Self : ArrayOps < T , N > ,
348
- U : ArraySize < T > ,
348
+ U : ArraySize ,
349
349
{
350
350
#[ inline]
351
351
fn borrow_mut ( & mut self ) -> & mut [ T ; N ] {
@@ -356,7 +356,7 @@ where
356
356
impl < T , U , const N : usize > From < [ T ; N ] > for Array < T , U >
357
357
where
358
358
Self : ArrayOps < T , N > ,
359
- U : ArraySize < T > ,
359
+ U : ArraySize ,
360
360
{
361
361
#[ inline]
362
362
fn from ( arr : [ T ; N ] ) -> Array < T , U > {
@@ -367,7 +367,7 @@ where
367
367
impl < T , I , U > Index < I > for Array < T , U >
368
368
where
369
369
[ T ] : Index < I > ,
370
- U : ArraySize < T > ,
370
+ U : ArraySize ,
371
371
{
372
372
type Output = <[ T ] as Index < I > >:: Output ;
373
373
@@ -380,7 +380,7 @@ where
380
380
impl < T , I , U > IndexMut < I > for Array < T , U >
381
381
where
382
382
[ T ] : IndexMut < I > ,
383
- U : ArraySize < T > ,
383
+ U : ArraySize ,
384
384
{
385
385
#[ inline]
386
386
fn index_mut ( & mut self , index : I ) -> & mut Self :: Output {
@@ -391,8 +391,8 @@ where
391
391
impl < ' a , T , U > TryFrom < & ' a [ T ] > for Array < T , U >
392
392
where
393
393
T : Copy ,
394
- U : ArraySize < T > ,
395
- U :: ArrayType : TryFrom < & ' a [ T ] , Error = TryFromSliceError > ,
394
+ U : ArraySize ,
395
+ U :: ArrayType < T > : TryFrom < & ' a [ T ] , Error = TryFromSliceError > ,
396
396
{
397
397
type Error = TryFromSliceError ;
398
398
0 commit comments