From 9bf612b064e013e659d67b8c10af22b4e925350d Mon Sep 17 00:00:00 2001 From: LeWimbes <12753781+LeWimbes@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:06:58 +0100 Subject: [PATCH] chore: switch to serde_core --- Cargo.toml | 5 ++++- src/arrayvec.rs | 4 ++-- src/tinyvec.rs | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 819fd44..4eea35f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ exclude = ["/.github", "/*.py", "/*.sh", "/src-backup"] [dependencies] tinyvec_macros = { version = "0.1", optional = true } # Provides `Serialize` and `Deserialize` implementations -serde = { version = "1.0", optional = true, default-features = false } +serde_core = { version = "1.0", optional = true, default-features = false } # Provides derived `Arbitrary` implementations arbitrary = { version = "1", optional = true } # Provides `BorshSerialize` and `BorshDeserialize implementations @@ -31,6 +31,9 @@ alloc = ["tinyvec_macros"] # Provide things that require Rust's `std` module std = ["alloc"] +# Provides `Serialize` and `Deserialize` implementations +serde = ["dep:serde_core"] + # (not part of Vec!) Extra methods to let you grab the slice of memory after the # "active" portion of an `ArrayVec` or `SliceVec`. grab_spare_slice = [] diff --git a/src/arrayvec.rs b/src/arrayvec.rs index c55796d..5c98034 100644 --- a/src/arrayvec.rs +++ b/src/arrayvec.rs @@ -4,11 +4,11 @@ use core::convert::{TryFrom, TryInto}; #[cfg(feature = "serde")] use core::marker::PhantomData; #[cfg(feature = "serde")] -use serde::de::{ +use serde_core::de::{ Deserialize, Deserializer, Error as DeserializeError, SeqAccess, Visitor, }; #[cfg(feature = "serde")] -use serde::ser::{Serialize, SerializeSeq, Serializer}; +use serde_core::ser::{Serialize, SerializeSeq, Serializer}; /// Helper to make an `ArrayVec`. /// diff --git a/src/tinyvec.rs b/src/tinyvec.rs index d2bf218..4f61511 100644 --- a/src/tinyvec.rs +++ b/src/tinyvec.rs @@ -10,9 +10,9 @@ use alloc::collections::TryReserveError; #[cfg(feature = "serde")] use core::marker::PhantomData; #[cfg(feature = "serde")] -use serde::de::{Deserialize, Deserializer, SeqAccess, Visitor}; +use serde_core::de::{Deserialize, Deserializer, SeqAccess, Visitor}; #[cfg(feature = "serde")] -use serde::ser::{Serialize, SerializeSeq, Serializer}; +use serde_core::ser::{Serialize, SerializeSeq, Serializer}; /// Helper to make a `TinyVec`. ///