Skip to content
Myr

Switch all crates to edition 2021

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Oli Scherer · committed by Oli Scherer · parent 6ac8049 · Browse files · 6 files+10 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+10 added−9 removed

  • other:+10 added−9 removed

6 files+10 added−9 removed

modified:serde/src/de/mod.rs+4 added-4 removed
204 unmodified lines
205 /// 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 }212213 /// Raised when a `Deserialize` receives a value of the right type but that
9 unmodified lines
223 /// 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 }230231 /// Raised when deserializing a sequence or map and the input data contains
5 unmodified lines
237 /// 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 }244245 /// Raised when a `Deserialize` enum type received a variant with an
245 unmodified lines
491 formatter.write_str(self)492 }493}494495impl Display for Expected + '_ {495impl Display for dyn Expected + '_ {496 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {497 Expected::fmt(self, formatter)498 }499}
1836 unmodified lines
modified:serde/src/private/de.rs+2 added-2 removed
1063 unmodified lines
1064 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 }10711072 fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>
580 unmodified lines
1653 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 }16601661 fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>
1143 unmodified lines
modified:serde/Cargo.toml+1 added-1 removed
modified:serde_derive/Cargo.toml+1 added-1 removed
modified:serde_derive_internals/Cargo.toml+1 added-1 removed
modified:Cargo.toml+1 added