From 048a64caec40e5a962f6919354fb7b6a8f0d34fd Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 30 Apr 2022 20:16:31 -0700 Subject: [PATCH] Resolve type_repetition_in_bounds clippy lint error: this type has already been used as a bound predicate --> src/value/ser.rs:278:9 | 278 | T: Display, | ^^^^^^^^^^ | = note: `-D clippy::type-repetition-in-bounds` implied by `-D clippy::pedantic` = help: consider combining the bounds: `T: Sized + Display` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds error: this type has already been used as a bound predicate --> src/value/ser.rs:611:9 | 611 | T: Display, | ^^^^^^^^^^ | = help: consider combining the bounds: `T: Sized + Display` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds --- src/value/ser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/value/ser.rs b/src/value/ser.rs index 179380a51..098703767 100644 --- a/src/value/ser.rs +++ b/src/value/ser.rs @@ -273,9 +273,9 @@ impl serde::Serializer for Serializer { }) } - fn collect_str(self, value: &T) -> Result + fn collect_str(self, value: &T) -> Result where - T: Display, + T: ?Sized + Display, { Ok(Value::String(value.to_string())) } @@ -606,9 +606,9 @@ impl serde::Serializer for MapKeySerializer { Err(key_must_be_a_string()) } - fn collect_str(self, value: &T) -> Result + fn collect_str(self, value: &T) -> Result where - T: Display, + T: ?Sized + Display, { Ok(value.to_string()) }