Skip to content

Commit

Permalink
feat(eventually): add derive(Copy) to serde::Convert (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ar3s3ru authored Feb 24, 2024
1 parent 8fc8678 commit 0ac7441
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions eventually/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<S, T> Serde<T> for S where S: Serializer<T> + Deserializer<T> {}
/// Implements the [Serde] trait to translate between two different types,
/// and using the specified [Serde] for serialization and deserialization
/// using the new `Out` type.
#[derive(Clone)]
#[derive(Clone, Copy)]
pub struct Convert<In, Out, S>
where
In: Send + Sync,
Expand Down Expand Up @@ -183,24 +183,12 @@ where
/// as wire protocol.
#[cfg(feature = "serde-prost")]
#[cfg(feature = "serde-json")]
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Default)]
pub struct ProtoJson<T>(PhantomData<T>)
where
T: prost::Message + Serialize + Default,
for<'de> T: Deserialize<'de>;

#[cfg(feature = "serde-prost")]
#[cfg(feature = "serde-json")]
impl<T> Default for ProtoJson<T>
where
T: prost::Message + Serialize + Default,
for<'de> T: Deserialize<'de>,
{
fn default() -> Self {
Self(PhantomData)
}
}

#[cfg(feature = "serde-prost")]
#[cfg(feature = "serde-json")]
impl<T> Serializer<T> for ProtoJson<T>
Expand Down

0 comments on commit 0ac7441

Please sign in to comment.