From 298e4eadc7e3745ae94309e6dc6e3855e7e50b62 Mon Sep 17 00:00:00 2001 From: Huan-Cheng Chang Date: Mon, 2 Dec 2024 11:09:41 +0000 Subject: [PATCH] Fix lint errors with toolchain 1.83 (#1561) --- src/errors/validation_exception.rs | 4 +- src/input/datetime.rs | 12 ++--- src/input/input_abstract.rs | 16 ++++-- src/input/input_json.rs | 54 ++++++++++++++----- src/input/input_python.rs | 42 +++++++++++---- src/input/input_string.rs | 39 ++++++++++---- src/input/return_enums.rs | 16 +++--- src/serializers/computed_fields.rs | 2 +- src/serializers/fields.rs | 2 +- src/serializers/infer.rs | 2 +- src/serializers/ser.rs | 20 +++---- src/serializers/shared.rs | 5 +- src/serializers/type_serializers/complex.rs | 2 +- src/serializers/type_serializers/dict.rs | 2 +- src/serializers/type_serializers/generator.rs | 2 +- src/serializers/type_serializers/list.rs | 2 +- .../type_serializers/set_frozenset.rs | 2 +- src/serializers/type_serializers/union.rs | 4 +- .../type_serializers/with_default.rs | 2 +- src/validators/function.rs | 6 +++ src/validators/mod.rs | 5 ++ src/validators/url.rs | 16 +++--- src/validators/with_default.rs | 10 ++-- 23 files changed, 178 insertions(+), 89 deletions(-) diff --git a/src/errors/validation_exception.rs b/src/errors/validation_exception.rs index ea851b495..c55d02427 100644 --- a/src/errors/validation_exception.rs +++ b/src/errors/validation_exception.rs @@ -582,7 +582,7 @@ struct ValidationErrorSerializer<'py> { input_type: &'py InputType, } -impl<'py> Serialize for ValidationErrorSerializer<'py> { +impl Serialize for ValidationErrorSerializer<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -614,7 +614,7 @@ struct PyLineErrorSerializer<'py> { input_type: &'py InputType, } -impl<'py> Serialize for PyLineErrorSerializer<'py> { +impl Serialize for PyLineErrorSerializer<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/src/input/datetime.rs b/src/input/datetime.rs index da68462d7..ed1ba51b4 100644 --- a/src/input/datetime.rs +++ b/src/input/datetime.rs @@ -24,7 +24,7 @@ pub enum EitherDate<'a> { Py(Bound<'a, PyDate>), } -impl<'a> From for EitherDate<'a> { +impl From for EitherDate<'_> { fn from(date: Date) -> Self { Self::Raw(date) } @@ -45,7 +45,7 @@ pub fn pydate_as_date(py_date: &Bound<'_, PyAny>) -> PyResult { }) } -impl<'a> EitherDate<'a> { +impl EitherDate<'_> { pub fn as_raw(&self) -> PyResult { match self { Self::Raw(date) => Ok(date.clone()), @@ -68,7 +68,7 @@ pub enum EitherTime<'a> { Py(Bound<'a, PyTime>), } -impl<'a> From