Skip to content

Commit 048a64c

Browse files
committed
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
1 parent 585e4c5 commit 048a64c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/value/ser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ impl serde::Serializer for Serializer {
273273
})
274274
}
275275

276-
fn collect_str<T: ?Sized>(self, value: &T) -> Result<Value>
276+
fn collect_str<T>(self, value: &T) -> Result<Value>
277277
where
278-
T: Display,
278+
T: ?Sized + Display,
279279
{
280280
Ok(Value::String(value.to_string()))
281281
}
@@ -606,9 +606,9 @@ impl serde::Serializer for MapKeySerializer {
606606
Err(key_must_be_a_string())
607607
}
608608

609-
fn collect_str<T: ?Sized>(self, value: &T) -> Result<String>
609+
fn collect_str<T>(self, value: &T) -> Result<String>
610610
where
611-
T: Display,
611+
T: ?Sized + Display,
612612
{
613613
Ok(value.to_string())
614614
}

0 commit comments

Comments
 (0)