@@ -19,9 +19,8 @@ use allocator_api2::vec::Vec as InnerVec;
1919use bumpalo:: Bump ;
2020#[ cfg( any( feature = "serialize" , test) ) ]
2121use serde:: { ser:: SerializeSeq , Serialize , Serializer } ;
22- use simdutf8:: basic:: Utf8Error ;
2322
24- use crate :: { Allocator , Box , String } ;
23+ use crate :: { Allocator , Box } ;
2524
2625/// A `Vec` without [`Drop`], which stores its data in the arena allocator.
2726///
@@ -209,29 +208,6 @@ impl<'alloc, T> Vec<'alloc, T> {
209208 }
210209}
211210
212- impl < ' alloc > Vec < ' alloc , u8 > {
213- /// Convert `Vec<u8>` into [`String`].
214- ///
215- /// # Errors
216- /// Returns [`Err`] if the `Vec` does not comprise a valid UTF-8 string.
217- pub fn into_string ( self ) -> Result < String < ' alloc > , Utf8Error > {
218- String :: from_utf8 ( self )
219- }
220-
221- /// Convert `Vec<u8>` into [`String`], without checking bytes comprise a valid UTF-8 string.
222- ///
223- /// Does not copy the contents of the `Vec`, converts in place. This is a zero-cost operation.
224- ///
225- /// # SAFETY
226- /// Caller must ensure this `Vec<u8>` comprises a valid UTF-8 string.
227- #[ expect( clippy:: missing_safety_doc, clippy:: unnecessary_safety_comment) ]
228- #[ inline( always) ] // `#[inline(always)]` because this is a no-op at runtime
229- pub unsafe fn into_string_unchecked ( self ) -> String < ' alloc > {
230- // SAFETY: Caller guarantees vec comprises a valid UTF-8 string.
231- String :: from_utf8_unchecked ( self )
232- }
233- }
234-
235211impl < ' alloc , T > ops:: Deref for Vec < ' alloc , T > {
236212 type Target = InnerVec < T , & ' alloc Bump > ;
237213
0 commit comments