Switch all crates to edition 2021

This commit is contained in:
Oli Scherer
2025-03-05 09:51:32 +00:00
parent 6ac8049b92
commit e3a4165363
6 changed files with 10 additions and 9 deletions
+1
View File
@@ -5,6 +5,7 @@ members = [
"serde_derive_internals",
"test_suite",
]
resolver = "2"
[patch.crates-io]
serde = { path = "serde" }
+1 -1
View File
@@ -6,7 +6,7 @@ build = "build.rs"
categories = ["encoding", "no-std", "no-std::no-alloc"]
description = "A generic serialization/deserialization framework"
documentation = "https://docs.rs/serde"
edition = "2018"
edition = "2021"
homepage = "https://serde.rs"
keywords = ["serde", "serialization", "no_std"]
license = "MIT OR Apache-2.0"
+4 -4
View File
@@ -206,7 +206,7 @@ macro_rules! declare_error_trait {
/// containing an integer, the unexpected type is the integer and the
/// expected type is the string.
#[cold]
fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self {
fn invalid_type(unexp: Unexpected, exp: &dyn Expected) -> Self {
Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp))
}
@@ -224,7 +224,7 @@ macro_rules! declare_error_trait {
/// that is not valid UTF-8, the unexpected value is the bytes and the
/// expected value is a string.
#[cold]
fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self {
fn invalid_value(unexp: Unexpected, exp: &dyn Expected) -> Self {
Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp))
}
@@ -238,7 +238,7 @@ macro_rules! declare_error_trait {
/// expected. For example `exp` might say that a tuple of size 6 was
/// expected.
#[cold]
fn invalid_length(len: usize, exp: &Expected) -> Self {
fn invalid_length(len: usize, exp: &dyn Expected) -> Self {
Error::custom(format_args!("invalid length {}, expected {}", len, exp))
}
@@ -492,7 +492,7 @@ impl Expected for &str {
}
}
impl Display for Expected + '_ {
impl Display for dyn Expected + '_ {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expected::fmt(self, formatter)
}
+2 -2
View File
@@ -1065,7 +1065,7 @@ mod content {
E: de::Error,
{
#[cold]
fn invalid_type(self, exp: &Expected) -> E {
fn invalid_type(self, exp: &dyn Expected) -> E {
de::Error::invalid_type(self.content.unexpected(), exp)
}
@@ -1654,7 +1654,7 @@ mod content {
E: de::Error,
{
#[cold]
fn invalid_type(self, exp: &Expected) -> E {
fn invalid_type(self, exp: &dyn Expected) -> E {
de::Error::invalid_type(self.content.unexpected(), exp)
}
+1 -1
View File
@@ -5,7 +5,7 @@ authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay
categories = ["no-std", "no-std::no-alloc"]
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
documentation = "https://serde.rs/derive.html"
edition = "2015"
edition = "2021"
exclude = ["build.rs"]
homepage = "https://serde.rs"
keywords = ["serde", "serialization", "no_std", "derive"]
+1 -1
View File
@@ -4,7 +4,7 @@ version = "0.29.1"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
description = "AST representation used by Serde derive macros. Unstable."
documentation = "https://docs.rs/serde_derive_internals"
edition = "2015"
edition = "2021"
exclude = ["build.rs"]
homepage = "https://serde.rs"
keywords = ["serde", "serialization"]