From 7a0397451e014ff98b297e5c20ec8e5c5e578522 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 6 Nov 2017 22:40:04 -0800 Subject: [PATCH] Allow serde_test::Configure to be dynamically sized This is a more cautious choice for the trait. In the future we may need a `whatever_ref(&self)` that works for !Sized types. --- serde_test/src/configure.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serde_test/src/configure.rs b/serde_test/src/configure.rs index 57384745..bb6c17f4 100644 --- a/serde_test/src/configure.rs +++ b/serde_test/src/configure.rs @@ -71,18 +71,18 @@ pub struct Compact(T); /// ); /// } /// ``` -pub trait Configure : Sized { +pub trait Configure { /// Marks `self` as using `is_human_readable == true` - fn readable(self) -> Readable { + fn readable(self) -> Readable where Self: Sized { Readable(self) } /// Marks `self` as using `is_human_readable == false` - fn compact(self) -> Compact { + fn compact(self) -> Compact where Self: Sized { Compact(self) } } -impl Configure for T {} +impl Configure for T {} impl Serialize for Readable where