@@ -23,7 +23,6 @@ use serde::{Serialize, Deserialize, Serializer, Deserializer};
2323use crate :: LenUint ;
2424use crate :: errors:: CapacityError ;
2525use crate :: arrayvec_impl:: ArrayVecImpl ;
26- use crate :: utils:: MakeMaybeUninit ;
2726
2827/// A vector with a fixed capacity.
2928///
@@ -82,20 +81,6 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
8281 }
8382 }
8483
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-
9984 /// Return the number of elements in the `ArrayVecCopy`.
10085 ///
10186 /// ```
@@ -106,7 +91,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
10691 /// assert_eq!(array.len(), 2);
10792 /// ```
10893 #[ inline( always) ]
109- pub const fn len ( & self ) -> usize { self . len as usize }
94+ pub fn len ( & self ) -> usize { self . len as usize }
11095
11196 /// Returns whether the `ArrayVecCopy` is empty.
11297 ///
@@ -118,7 +103,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
118103 /// assert_eq!(array.is_empty(), true);
119104 /// ```
120105 #[ inline]
121- pub const fn is_empty ( & self ) -> bool { self . len ( ) == 0 }
106+ pub fn is_empty ( & self ) -> bool { self . len ( ) == 0 }
122107
123108 /// Return the capacity of the `ArrayVecCopy`.
124109 ///
@@ -129,7 +114,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
129114 /// assert_eq!(array.capacity(), 3);
130115 /// ```
131116 #[ inline( always) ]
132- pub const fn capacity ( & self ) -> usize { CAP }
117+ pub fn capacity ( & self ) -> usize { CAP }
133118
134119 /// Return true if the `ArrayVecCopy` is completely filled to its capacity, false otherwise.
135120 ///
@@ -141,7 +126,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
141126 /// array.push(1);
142127 /// assert!(array.is_full());
143128 /// ```
144- pub const fn is_full ( & self ) -> bool { self . len ( ) == self . capacity ( ) }
129+ pub fn is_full ( & self ) -> bool { self . len ( ) == self . capacity ( ) }
145130
146131 /// Returns the capacity left in the `ArrayVecCopy`.
147132 ///
@@ -152,7 +137,7 @@ impl<T: Copy, const CAP: usize> ArrayVecCopy<T, CAP> {
152137 /// array.pop();
153138 /// assert_eq!(array.remaining_capacity(), 1);
154139 /// ```
155- pub const fn remaining_capacity ( & self ) -> usize {
140+ pub fn remaining_capacity ( & self ) -> usize {
156141 self . capacity ( ) - self . len ( )
157142 }
158143
0 commit comments