Skip to content

Commit 0ac7441

Browse files
authored
feat(eventually): add derive(Copy) to serde::Convert (#291)
1 parent 8fc8678 commit 0ac7441

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

eventually/src/serde.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<S, T> Serde<T> for S where S: Serializer<T> + Deserializer<T> {}
4545
/// Implements the [Serde] trait to translate between two different types,
4646
/// and using the specified [Serde] for serialization and deserialization
4747
/// using the new `Out` type.
48-
#[derive(Clone)]
48+
#[derive(Clone, Copy)]
4949
pub struct Convert<In, Out, S>
5050
where
5151
In: Send + Sync,
@@ -183,24 +183,12 @@ where
183183
/// as wire protocol.
184184
#[cfg(feature = "serde-prost")]
185185
#[cfg(feature = "serde-json")]
186-
#[derive(Clone, Copy)]
186+
#[derive(Clone, Copy, Default)]
187187
pub struct ProtoJson<T>(PhantomData<T>)
188188
where
189189
T: prost::Message + Serialize + Default,
190190
for<'de> T: Deserialize<'de>;
191191

192-
#[cfg(feature = "serde-prost")]
193-
#[cfg(feature = "serde-json")]
194-
impl<T> Default for ProtoJson<T>
195-
where
196-
T: prost::Message + Serialize + Default,
197-
for<'de> T: Deserialize<'de>,
198-
{
199-
fn default() -> Self {
200-
Self(PhantomData)
201-
}
202-
}
203-
204192
#[cfg(feature = "serde-prost")]
205193
#[cfg(feature = "serde-json")]
206194
impl<T> Serializer<T> for ProtoJson<T>

0 commit comments

Comments
 (0)