@@ -23,7 +23,6 @@ use serde::{Serialize, Deserialize, Serializer, Deserializer};
23
23
use crate :: LenUint ;
24
24
use crate :: errors:: CapacityError ;
25
25
use crate :: arrayvec_impl:: ArrayVecImpl ;
26
- use crate :: utils:: MakeMaybeUninit ;
27
26
28
27
/// A vector with a fixed capacity.
29
28
///
@@ -82,20 +81,6 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
82
81
}
83
82
}
84
83
85
- /// Create a new empty `ArrayVecCopy` (const fn).
86
- ///
87
- /// The maximum capacity is given by the generic parameter `CAP`.
88
- ///
89
- /// ```
90
- /// use arrayvec::ArrayVecCopy;
91
- ///
92
- /// static ARRAY: ArrayVecCopy<u8, 1024> = ArrayVecCopy::new_const();
93
- /// ```
94
- pub const fn new_const ( ) -> ArrayVecCopy < T , CAP > {
95
- assert_capacity_limit_const ! ( CAP ) ;
96
- ArrayVecCopy { xs : MakeMaybeUninit :: ARRAY , len : 0 }
97
- }
98
-
99
84
/// Return the number of elements in the `ArrayVecCopy`.
100
85
///
101
86
/// ```
@@ -106,7 +91,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
106
91
/// assert_eq!(array.len(), 2);
107
92
/// ```
108
93
#[ inline( always) ]
109
- pub const fn len ( & self ) -> usize { self . len as usize }
94
+ pub fn len ( & self ) -> usize { self . len as usize }
110
95
111
96
/// Returns whether the `ArrayVecCopy` is empty.
112
97
///
@@ -118,7 +103,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
118
103
/// assert_eq!(array.is_empty(), true);
119
104
/// ```
120
105
#[ inline]
121
- pub const fn is_empty ( & self ) -> bool { self . len ( ) == 0 }
106
+ pub fn is_empty ( & self ) -> bool { self . len ( ) == 0 }
122
107
123
108
/// Return the capacity of the `ArrayVecCopy`.
124
109
///
@@ -129,7 +114,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
129
114
/// assert_eq!(array.capacity(), 3);
130
115
/// ```
131
116
#[ inline( always) ]
132
- pub const fn capacity ( & self ) -> usize { CAP }
117
+ pub fn capacity ( & self ) -> usize { CAP }
133
118
134
119
/// Return true if the `ArrayVecCopy` is completely filled to its capacity, false otherwise.
135
120
///
@@ -141,7 +126,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
141
126
/// array.push(1);
142
127
/// assert!(array.is_full());
143
128
/// ```
144
- pub const fn is_full ( & self ) -> bool { self . len ( ) == self . capacity ( ) }
129
+ pub fn is_full ( & self ) -> bool { self . len ( ) == self . capacity ( ) }
145
130
146
131
/// Returns the capacity left in the `ArrayVecCopy`.
147
132
///
@@ -152,7 +137,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
152
137
/// array.pop();
153
138
/// assert_eq!(array.remaining_capacity(), 1);
154
139
/// ```
155
- pub const fn remaining_capacity ( & self ) -> usize {
140
+ pub fn remaining_capacity ( & self ) -> usize {
156
141
self . capacity ( ) - self . len ( )
157
142
}
158
143
0 commit comments