Skip to content

Commit 8c11af7

Browse files
committed
Do not deserialize with custom allocators
1 parent 434b2f8 commit 8c11af7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/lib.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,30 +3581,28 @@ where
35813581

35823582
#[cfg(feature = "serde")]
35833583
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
3584-
impl<'de, T, const N: usize, #[cfg(feature = "allocator_api")] A: Allocator> Deserialize<'de> for alloc_param!(SmallVec<T, N, A>)
3584+
impl<'de, T, const N: usize> Deserialize<'de> for SmallVec<T, N>
35853585
where
35863586
T: Deserialize<'de>,
35873587
{
35883588
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35893589
deserializer.deserialize_seq(SmallVecVisitor {
3590-
phantom_type: PhantomData,
3591-
phantom_alloc: PhantomData,
3590+
phantom: PhantomData,
35923591
})
35933592
}
35943593
}
35953594

35963595
#[cfg(feature = "serde")]
3597-
struct SmallVecVisitor<T, const N: usize, #[cfg(feature = "allocator_api")] A: Allocator> {
3598-
phantom_type: PhantomData<T>,
3599-
phantom_alloc: PhantomData<A>,
3596+
struct SmallVecVisitor<T, const N: usize> {
3597+
phantom: PhantomData<T>,
36003598
}
36013599

36023600
#[cfg(feature = "serde")]
3603-
impl<'de, T, const N: usize, #[cfg(feature = "allocator_api")] A: Allocator> Visitor<'de> for alloc_param!(SmallVecVisitor<T, N, A>)
3601+
impl<'de, T, const N: usize> Visitor<'de> for SmallVecVisitor<T, N>
36043602
where
36053603
T: Deserialize<'de>,
36063604
{
3607-
type Value = alloc_param!(SmallVec<T, N, A>);
3605+
type Value = SmallVec<T, N>;
36083606

36093607
fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
36103608
formatter.write_str("a sequence")

0 commit comments

Comments
 (0)