Merge pull request #2901 from serde-rs/msrv-and-edition-bump
Before adoption: this commit came in with the history the project adopted, so no landing records it.
MSRV (1.56) and edition (2021) bump
authored by David Tolnay · committed by GitHub · parents 49d098d, 8b0e95b · Browse files · 15 files·+55 added−150 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
15 files+55 added−150 removed
- other:+55 added−150 removed
Provenance
- Commit
da0b473- Tree
788a60f- Author
David Tolnay <dtolnay@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
49d098d- Parent 2
8b0e95b
15 files changed+55 added−150 removed
modified:.github/workflows/ci.yml+2 added-11 removed
82 unmodified lines8384858687878889909192939495969798991001019 unmodified lines11111211311411411511611711811912012112212311511611711859 unmodified lines82 unmodified lines runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust: [1.31.0, 1.34.0] rust: [1.56.0, 1.60.0] timeout-minutes: 45 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} - run: sed -i '/"test_suite"/d' Cargo.toml - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features - run: cd serde && cargo build --no-default-features --features alloc - run: cd serde && cargo build
derive: name: Rust 1.61.09 unmodified lines - run: cd serde && cargo check --no-default-features - run: cd serde && cargo check - run: cd serde_derive && cargo check
alloc: name: Rust 1.36.0 runs-on: ubuntu-latest timeout-minutes: 45 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.36.0 - run: sed -i '/"test_suite"/d' Cargo.toml - run: cd serde && cargo build --no-default-features --features alloc
minimal: name: Minimal versions runs-on: ubuntu-latest timeout-minutes: 4559 unmodified linesmodified:serde/src/de/impls.rs+34 added-48 removed
78 unmodified lines79 80 ////////////////////////////////////////////////////////////////////////////////81 82 macro_rules! impl_deserialize_num {83- ($primitive:ident, $nonzero:ident $(cfg($($cfg:tt)*))*, $deserialize:ident $($method:ident!($($val:ident : $visit:ident)*);)*) => {83+ ($primitive:ident, $nonzero:ident, $deserialize:ident $($method:ident!($($val:ident : $visit:ident)*);)*) => {84 impl_deserialize_num!($primitive, $deserialize $($method!($($val : $visit)*);)*);85 86- $(#[cfg($($cfg)*)])*86 impl<'de> Deserialize<'de> for num::$nonzero {87 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>88 where89 D: Deserializer<'de>,136 unmodified lines226 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>227 where228 E: Error,229 {231- #[cfg(any(no_float_copysign, not(feature = "std")))]230+ #[cfg(not(feature = "std"))]231 {232 Ok(v as Self::Value)233 }234 236- #[cfg(all(not(no_float_copysign), feature = "std"))]235+ #[cfg(feature = "std")]236 {237 // Preserve sign of NaN. The `as` produces a nondeterministic sign.238 let sign = if v.is_sign_positive() { 1.0 } else { -1.0 };239 Ok((v as Self::Value).copysign(sign))8 unmodified lines248 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>249 where250 E: Error,251 {253- if Self::Value::min_value() as i64 <= v as i64254- && v as i64 <= Self::Value::max_value() as i64255- {256- Ok(v as Self::Value)257- } else {258- Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))259- }252+ Self::Value::try_from(v as i64)253+ .map_err(|_| Error::invalid_value(Unexpected::Signed(v as i64), &self))254 }255 };256 257 (nonzero $primitive:ident $ty:ident : $visit:ident) => {258 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>259 where260 E: Error,261 {268- if $primitive::min_value() as i64 <= v as i64269- && v as i64 <= $primitive::max_value() as i64270- {271- if let Some(nonzero) = Self::Value::new(v as $primitive) {262+ if let Ok(v) = $primitive::try_from(v as i64) {263+ if let Some(nonzero) = Self::Value::new(v) {264 return Ok(nonzero);265 }266 }267 Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))22 unmodified lines290 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>291 where292 E: Error,293 {302- if 0 <= v && v as u64 <= Self::Value::max_value() as u64 {303- Ok(v as Self::Value)304- } else {305- Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))294+ if 0 <= v {295+ #[allow(irrefutable_let_patterns)]296+ if let Ok(v) = Self::Value::try_from(v as u64) {297+ return Ok(v as Self::Value);298+ }299 }300+ Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))301 }302 };303 304 (nonzero $primitive:ident $ty:ident : $visit:ident) => {305 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>306 where307 E: Error,308 {309+ if 0 < v {310+ #[allow(irrefutable_let_patterns)]315- if 0 < v && v as u64 <= $primitive::max_value() as u64 {316- if let Some(nonzero) = Self::Value::new(v as $primitive) {317- return Ok(nonzero);311+ if let Ok(v) = $primitive::try_from(v as u64) {312+ if let Some(nonzero) = Self::Value::new(v) {313+ return Ok(nonzero);314+ }315 }316 }317 Err(Error::invalid_value(Unexpected::Signed(v as i64), &self))318 }21 unmodified lines340 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>341 where342 E: Error,343 {347- if v as u64 <= Self::Value::max_value() as u64 {348- Ok(v as Self::Value)349- } else {350- Err(Error::invalid_value(Unexpected::Unsigned(v as u64), &self))351- }344+ Self::Value::try_from(v as u64)345+ .map_err(|_| Error::invalid_value(Unexpected::Unsigned(v as u64), &self))346 }347 };348 349 (nonzero $primitive:ident $ty:ident : $visit:ident) => {350 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>351 where352 E: Error,353 {360- if v as u64 <= $primitive::max_value() as u64 {361- if let Some(nonzero) = Self::Value::new(v as $primitive) {354+ if let Ok(v) = $primitive::try_from(v as u64) {355+ if let Some(nonzero) = Self::Value::new(v) {356 return Ok(nonzero);357 }358 }359 Err(Error::invalid_value(Unexpected::Unsigned(v as u64), &self))4 unmodified lines364 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>365 where366 E: Error,367 {374- if v as u64 <= $primitive::MAX as u64 {368+ if let Ok(v) = $primitive::try_from(v as u64) {369 Ok(Saturating(v as $primitive))370 } else {371 Ok(Saturating($primitive::MAX))372 }1 unmodified line374 };375 }376 377 impl_deserialize_num! {384- i8, NonZeroI8 cfg(not(no_num_nonzero_signed)), deserialize_i8378+ i8, NonZeroI8, deserialize_i8379 num_self!(i8:visit_i8);380 int_to_int!(i16:visit_i16 i32:visit_i32 i64:visit_i64);381 uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);382 }383 384 impl_deserialize_num! {391- i16, NonZeroI16 cfg(not(no_num_nonzero_signed)), deserialize_i16385+ i16, NonZeroI16, deserialize_i16386 num_self!(i16:visit_i16);387 num_as_self!(i8:visit_i8);388 int_to_int!(i32:visit_i32 i64:visit_i64);389 uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);390 }391 392 impl_deserialize_num! {399- i32, NonZeroI32 cfg(not(no_num_nonzero_signed)), deserialize_i32393+ i32, NonZeroI32, deserialize_i32394 num_self!(i32:visit_i32);395 num_as_self!(i8:visit_i8 i16:visit_i16);396 int_to_int!(i64:visit_i64);397 uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);398 }399 400 impl_deserialize_num! {407- i64, NonZeroI64 cfg(not(no_num_nonzero_signed)), deserialize_i64401+ i64, NonZeroI64, deserialize_i64402 num_self!(i64:visit_i64);403 num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32);404 uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);405 }406 407 impl_deserialize_num! {414- isize, NonZeroIsize cfg(not(no_num_nonzero_signed)), deserialize_i64408+ isize, NonZeroIsize, deserialize_i64409 num_as_self!(i8:visit_i8 i16:visit_i16);410 int_to_int!(i32:visit_i32 i64:visit_i64);411 uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);412 }56 unmodified lines469 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>470 where471 E: Error,472 {479- if v as i128 >= Self::Value::min_value() as i128480- && v as u128 <= Self::Value::max_value() as u128481- {473+ if v as i128 >= Self::Value::MIN as i128 && v as u128 <= Self::Value::MAX as u128 {474 Ok(v as Self::Value)475 } else {476 Err(Error::invalid_value(477 Unexpected::Other(stringify!($ty)),7 unmodified lines485 fn $visit<E>(self, v: $ty) -> Result<Self::Value, E>486 where487 E: Error,488 {497- if v as i128 >= $primitive::min_value() as i128498- && v as u128 <= $primitive::max_value() as u128499- {489+ if v as i128 >= $primitive::MIN as i128 && v as u128 <= $primitive::MAX as u128 {490 if let Some(nonzero) = Self::Value::new(v as $primitive) {491 Ok(nonzero)492 } else {493 Err(Error::invalid_value(Unexpected::Unsigned(0), &self))23 unmodified lines517 };518 }519 520 impl_deserialize_num! {531- i128, NonZeroI128 cfg(not(no_num_nonzero_signed)), deserialize_i128521+ i128, NonZeroI128, deserialize_i128522 num_self!(i128:visit_i128);523 num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);524 num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);525 num_128!(u128:visit_u128);1878 unmodified lines2404 }2405 2406 const FIELDS: &[&str] = &["secs_since_epoch", "nanos_since_epoch"];2407 let duration = tri!(deserializer.deserialize_struct("SystemTime", FIELDS, DurationVisitor));2418- #[cfg(not(no_systemtime_checked_add))]2419- let ret = UNIX_EPOCH2408+ UNIX_EPOCH2409 .checked_add(duration)2421- .ok_or_else(|| D::Error::custom("overflow deserializing SystemTime"));2422- #[cfg(no_systemtime_checked_add)]2423- let ret = Ok(UNIX_EPOCH + duration);2424- ret2410+ .ok_or_else(|| D::Error::custom("overflow deserializing SystemTime"))2411 }2412 }2413 2414 ////////////////////////////////////////////////////////////////////////////////755 unmodified linesmodified:serde/src/de/mod.rs+4 added-4 removed
204 unmodified lines205 /// For example if we try to deserialize a String out of a JSON file206 /// containing an integer, the unexpected type is the integer and the207 /// expected type is the string.208 #[cold]209- fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self {209+ fn invalid_type(unexp: Unexpected, exp: &dyn Expected) -> Self {210 Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp))211 }212 213 /// Raised when a `Deserialize` receives a value of the right type but that9 unmodified lines223 /// For example if we try to deserialize a String out of some binary data224 /// that is not valid UTF-8, the unexpected value is the bytes and the225 /// expected value is a string.226 #[cold]227- fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self {227+ fn invalid_value(unexp: Unexpected, exp: &dyn Expected) -> Self {228 Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp))229 }230 231 /// Raised when deserializing a sequence or map and the input data contains5 unmodified lines237 /// The `exp` argument provides information about what data was being238 /// expected. For example `exp` might say that a tuple of size 6 was239 /// expected.240 #[cold]241- fn invalid_length(len: usize, exp: &Expected) -> Self {241+ fn invalid_length(len: usize, exp: &dyn Expected) -> Self {242 Error::custom(format_args!("invalid length {}, expected {}", len, exp))243 }244 245 /// Raised when a `Deserialize` enum type received a variant with an245 unmodified lines491 formatter.write_str(self)492 }493 }494 495-impl Display for Expected + '_ {495+impl Display for dyn Expected + '_ {496 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {497 Expected::fmt(self, formatter)498 }499 }1836 unmodified linesmodified:serde/src/de/size_hint.rs+1 added
1+#[cfg(any(feature = "std", feature = "alloc"))]2 use crate::lib::*;3 4 pub fn from_bounds<I>(iter: &I) -> Option<usize>5 where25 unmodified linesmodified:serde/src/private/de.rs+2 added-2 removed
1063 unmodified lines1064 where1065 E: de::Error,1066 {1067 #[cold]1068- fn invalid_type(self, exp: &Expected) -> E {1068+ fn invalid_type(self, exp: &dyn Expected) -> E {1069 de::Error::invalid_type(self.content.unexpected(), exp)1070 }1071 1072 fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>580 unmodified lines1653 where1654 E: de::Error,1655 {1656 #[cold]1657- fn invalid_type(self, exp: &Expected) -> E {1657+ fn invalid_type(self, exp: &dyn Expected) -> E {1658 de::Error::invalid_type(self.content.unexpected(), exp)1659 }1660 1661 fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>1143 unmodified linesmodified:serde/src/private/mod.rs-1 removed
18 unmodified lines19 20 #[cfg(any(feature = "alloc", feature = "std"))]21 pub use crate::lib::{ToString, Vec};22 23-#[cfg(not(no_core_try_from))]23 pub use crate::lib::convert::TryFrom;24 25 mod string {26 use crate::lib::*;21 unmodified linesmodified:serde/src/ser/impls.rs+4 added-54 removed
183 unmodified lines184 serializer.collect_seq(self)185 }186 }187 188-#[cfg(not(no_relaxed_trait_bounds))]188 macro_rules! seq_impl {189 (190 $(#[$attr:meta])*192- $ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)*>191+ $ty:ident <T $(, $typaram:ident : $bound:ident)*>192 ) => {193 $(#[$attr])*194 impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>195 where9 unmodified lines205 }206 }207 }208 210-#[cfg(no_relaxed_trait_bounds)]211-macro_rules! seq_impl {212- (213- $(#[$attr:meta])*214- $ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)*>215- ) => {216- $(#[$attr])*217- impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>218- where219- T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,220- $($typaram: $bound,)*221- {222- #[inline]223- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>224- where225- S: Serializer,226- {227- serializer.collect_seq(self)228- }229- }230- }231-}232-209 seq_impl! {210 #[cfg(any(feature = "std", feature = "alloc"))]211 #[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]236- BinaryHeap<T: Ord>212+ BinaryHeap<T>213 }214 215 seq_impl! {216 #[cfg(any(feature = "std", feature = "alloc"))]217 #[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]242- BTreeSet<T: Ord>218+ BTreeSet<T>219 }220 221 seq_impl! {222 #[cfg(feature = "std")]223 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]248- HashSet<T: Eq + Hash, H: BuildHasher>224+ HashSet<T, H: BuildHasher>225 }226 227 seq_impl! {228 #[cfg(any(feature = "std", feature = "alloc"))]191 unmodified lines420 }421 422 ////////////////////////////////////////////////////////////////////////////////423 448-#[cfg(not(no_relaxed_trait_bounds))]424 macro_rules! map_impl {425 (426 $(#[$attr:meta])*427 $ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>14 unmodified lines442 }443 }444 }445 471-#[cfg(no_relaxed_trait_bounds)]472-macro_rules! map_impl {473- (474- $(#[$attr:meta])*475- $ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>476- ) => {477- $(#[$attr])*478- impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>479- where480- K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,481- V: Serialize,482- $($typaram: $bound,)*483- {484- #[inline]485- fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>486- where487- S: Serializer,488- {489- serializer.collect_map(self)490- }491- }492- }493-}494-446 map_impl! {447 #[cfg(any(feature = "std", feature = "alloc"))]448 #[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]449 BTreeMap<K: Ord, V>140 unmodified lines590 NonZeroU128,591 NonZeroUsize,592 }593 643-#[cfg(not(no_num_nonzero_signed))]594 nonzero_integers! {595 NonZeroI8,596 NonZeroI16,597 NonZeroI32,449 unmodified linesmodified:serde/src/lib.rs-2 removed
173 unmodified lines174 pub use std::*;175 }176 177 pub use self::core::{f32, f64};178- pub use self::core::{i16, i32, i64, i8, isize};178 pub use self::core::{iter, num, ptr, str};180- pub use self::core::{u16, u32, u64, u8, usize};179 180 #[cfg(any(feature = "std", feature = "alloc"))]181 pub use self::core::{cmp, mem, slice};182 165 unmodified linesmodified:serde/src/std_error.rs+1 added-1 removed
40 unmodified lines41 /// impl serde::ser::StdError for MySerError {}42 /// ```43 pub trait Error: Debug + Display {44 /// The underlying cause of this error, if any.45- fn source(&self) -> Option<&(Error + 'static)> {45+ fn source(&self) -> Option<&(dyn Error + 'static)> {46 None47 }48 }modified:serde/build.rs-21 removed
16 unmodified lines17 println!("cargo:rustc-check-cfg=cfg(no_core_cstr)");18 println!("cargo:rustc-check-cfg=cfg(no_core_error)");19 println!("cargo:rustc-check-cfg=cfg(no_core_net)");20 println!("cargo:rustc-check-cfg=cfg(no_core_num_saturating)");21- println!("cargo:rustc-check-cfg=cfg(no_core_try_from)");21 println!("cargo:rustc-check-cfg=cfg(no_diagnostic_namespace)");22 println!("cargo:rustc-check-cfg=cfg(no_float_copysign)");24- println!("cargo:rustc-check-cfg=cfg(no_num_nonzero_signed)");25- println!("cargo:rustc-check-cfg=cfg(no_relaxed_trait_bounds)");23 println!("cargo:rustc-check-cfg=cfg(no_serde_derive)");24 println!("cargo:rustc-check-cfg=cfg(no_std_atomic)");25 println!("cargo:rustc-check-cfg=cfg(no_std_atomic64)");29- println!("cargo:rustc-check-cfg=cfg(no_systemtime_checked_add)");26 println!("cargo:rustc-check-cfg=cfg(no_target_has_atomic)");27 }28 29 let target = env::var("TARGET").unwrap();30 let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";31 36- // TryFrom, Atomic types, non-zero signed integers, and SystemTime::checked_add37- // stabilized in Rust 1.34:38- // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto39- // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#library-stabilizations40- if minor < 34 {41- println!("cargo:rustc-cfg=no_core_try_from");42- println!("cargo:rustc-cfg=no_num_nonzero_signed");43- println!("cargo:rustc-cfg=no_systemtime_checked_add");44- println!("cargo:rustc-cfg=no_relaxed_trait_bounds");45- }46-47- // f32::copysign and f64::copysign stabilized in Rust 1.35.48- // https://blog.rust-lang.org/2019/05/23/Rust-1.35.0.html#copy-the-sign-of-a-floating-point-number-onto-another49- if minor < 35 {50- println!("cargo:rustc-cfg=no_float_copysign");51- }52-32 // Support for #[cfg(target_has_atomic = "...")] stabilized in Rust 1.60.33 if minor < 60 {34 println!("cargo:rustc-cfg=no_target_has_atomic");35 // Allowlist of archs that support std::sync::atomic module. This is63 unmodified linesmodified:serde/Cargo.toml+2 added-2 removed
4 unmodified lines5 build = "build.rs"6 categories = ["encoding", "no-std", "no-std::no-alloc"]7 description = "A generic serialization/deserialization framework"8 documentation = "https://docs.rs/serde"9-edition = "2018"9+edition = "2021"10 homepage = "https://serde.rs"11 keywords = ["serde", "serialization", "no_std"]12 license = "MIT OR Apache-2.0"13 readme = "crates-io.md"14 repository = "https://github.com/serde-rs/serde"15-rust-version = "1.31"15+rust-version = "1.56"16 17 [dependencies]18 serde_derive = { version = "1", optional = true, path = "../serde_derive" }19 52 unmodified linesmodified:serde_derive/Cargo.toml+1 added-1 removed
3 unmodified lines4 authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]5 categories = ["no-std", "no-std::no-alloc"]6 description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"7 documentation = "https://serde.rs/derive.html"8-edition = "2015"8+edition = "2021"9 exclude = ["build.rs"]10 homepage = "https://serde.rs"11 keywords = ["serde", "serialization", "no_std", "derive"]12 license = "MIT OR Apache-2.0"29 unmodified linesmodified:serde_derive_internals/Cargo.toml+1 added-1 removed
2 unmodified lines3 version = "0.29.1"4 authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]5 description = "AST representation used by Serde derive macros. Unstable."6 documentation = "https://docs.rs/serde_derive_internals"7-edition = "2015"7+edition = "2021"8 exclude = ["build.rs"]9 homepage = "https://serde.rs"10 keywords = ["serde", "serialization"]11 license = "MIT OR Apache-2.0"20 unmodified linesmodified:Cargo.toml+1 added
3 unmodified lines4 "serde_derive",5 "serde_derive_internals",6 "test_suite",7 ]8+resolver = "2"9 10 [patch.crates-io]11 serde = { path = "serde" }12 4 unmodified linesmodified:README.md+2 added-2 removed
1-# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.31] [![serde_derive msrv]][Rust 1.61]1+# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.56] [![serde_derive msrv]][Rust 1.61]2 3 [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master4 [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster5 [Latest Version]: https://img.shields.io/crates/v/serde.svg6 [crates.io]: https://crates.io/crates/serde7 [serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray8 [serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray9-[Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html9+[Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html10 [Rust 1.61]: https://blog.rust-lang.org/2022/05/19/Rust-1.61.0.html11 12 **Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**13 101 unmodified lines