Skip to content

Commit f905c53

Browse files
committed
More flexible EncoderDecoderBuilder Clone
1 parent 46887bb commit f905c53

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/enc_dec_builder/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub trait PtEncoderDecoder {
5252
Self: Sized;
5353
}
5454

55-
#[derive(Debug, Clone)]
55+
#[derive(Debug)]
5656
#[repr(transparent)]
5757
pub struct EncoderDecoderBuilder<T> {
5858
pub(crate) config: pt_config,
@@ -68,6 +68,15 @@ where
6868
}
6969
}
7070

71+
impl<T> Clone for EncoderDecoderBuilder<T> {
72+
fn clone(&self) -> Self {
73+
Self {
74+
config: self.config,
75+
target: PhantomData,
76+
}
77+
}
78+
}
79+
7180
impl<T> EncoderDecoderBuilder<T>
7281
where
7382
T: PtEncoderDecoder,

0 commit comments

Comments
 (0)