Skip to content

Commit aed6844

Browse files
authored
ci: lint fixes for rust 1.78 (#1289)
1 parent e1fc99d commit aed6844

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/errors/types.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,12 @@ fn field_from_context<'py, T: FromPyObject<'py>>(
5656
.map_err(|_| py_error_type!(PyTypeError; "{}: '{}' context value must be a {}", enum_name, field_name, type_name_fn()))
5757
}
5858

59-
fn cow_field_from_context<'py, T: FromPyObject<'py>, B: ?Sized + 'static>(
59+
fn cow_field_from_context<'py, T: FromPyObject<'py>, B: ToOwned<Owned = T> + ?Sized + 'static>(
6060
context: Option<&Bound<'py, PyDict>>,
6161
field_name: &str,
6262
enum_name: &str,
6363
_type_name_fn: fn() -> &'static str,
64-
) -> PyResult<Cow<'static, B>>
65-
where
66-
B: ToOwned<Owned = T>,
67-
{
64+
) -> PyResult<Cow<'static, B>> {
6865
let res: T = field_from_context(context, field_name, enum_name, || {
6966
type_name::<T>().split("::").last().unwrap()
7067
})?;

src/serializers/ser.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -236,23 +236,17 @@ where
236236
self.serialize_str(variant)
237237
}
238238

239-
fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T) -> Result<Self::Ok>
240-
where
241-
T: Serialize,
242-
{
239+
fn serialize_newtype_struct<T: Serialize + ?Sized>(self, _name: &'static str, value: &T) -> Result<Self::Ok> {
243240
value.serialize(self)
244241
}
245242

246-
fn serialize_newtype_variant<T: ?Sized>(
243+
fn serialize_newtype_variant<T: Serialize + ?Sized>(
247244
self,
248245
_name: &'static str,
249246
_variant_index: u32,
250247
variant: &'static str,
251248
value: &T,
252-
) -> Result<Self::Ok>
253-
where
254-
T: Serialize,
255-
{
249+
) -> Result<Self::Ok> {
256250
tri!(self
257251
.formatter
258252
.begin_object(&mut self.writer)

0 commit comments

Comments
 (0)