From 1c813cb234e64fa42601094b0e39d0dc83494911 Mon Sep 17 00:00:00 2001 From: Schneems Date: Thu, 19 Dec 2024 22:28:17 -0600 Subject: [PATCH] No need to import `use std::convert::Infallible;` --- README.md | 1 - src/fixtures/personV1_V2.txt | 1 - src/fixtures/try_personV1_V2.txt | 1 - src/lib.rs | 4 ++-- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cd5569b..b33f765 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ use serde::de::Deserializer; use serde::{Deserialize, Serialize}; use chrono::{DateTime, Utc}; -use std::convert::Infallible; #[derive(Deserialize, Serialize, Debug)] #[serde(deny_unknown_fields)] diff --git a/src/fixtures/personV1_V2.txt b/src/fixtures/personV1_V2.txt index 0c265fe..58da1f0 100644 --- a/src/fixtures/personV1_V2.txt +++ b/src/fixtures/personV1_V2.txt @@ -1,6 +1,5 @@ # use chrono::{DateTime, Utc}; # use serde::{Deserialize, Serialize}; -# use std::convert::Infallible; # # #[derive(Deserialize, Serialize, Debug)] # #[serde(deny_unknown_fields)] diff --git a/src/fixtures/try_personV1_V2.txt b/src/fixtures/try_personV1_V2.txt index 5294f98..9efe46d 100644 --- a/src/fixtures/try_personV1_V2.txt +++ b/src/fixtures/try_personV1_V2.txt @@ -1,5 +1,4 @@ # use serde::{Deserialize, Serialize}; -# use std::convert::Infallible; # # #[derive(Deserialize, Serialize, Debug)] # #[serde(deny_unknown_fields)] diff --git a/src/lib.rs b/src/lib.rs index e8c61e3..095d462 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -525,8 +525,8 @@ macro_rules! try_migrate_deserializer_chain { $deser(input) } } - impl From for $err { - fn from(_value: Infallible) -> Self { + impl From for $err { + fn from(_value: std::convert::Infallible) -> Self { unreachable!(); } }