diff --git a/crates/interledger-stream/src/packet.rs b/crates/interledger-stream/src/packet.rs index 16c9d5a57..8f3d7f5a8 100644 --- a/crates/interledger-stream/src/packet.rs +++ b/crates/interledger-stream/src/packet.rs @@ -372,7 +372,7 @@ impl<'a> fmt::Debug for Frame<'a> { } /// The Stream Frame types [as defined in the RFC](https://interledger.org/rfcs/0029-stream/#53-frames) -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Clone, Copy)] #[repr(u8)] pub enum FrameType { ConnectionClose = 0x01, @@ -415,7 +415,7 @@ impl From for FrameType { } /// The STREAM Error Codes [as defined in the RFC](https://interledger.org/rfcs/0029-stream/#54-error-codes) -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Clone, Copy)] #[repr(u8)] pub enum ErrorCode { NoError = 0x01, @@ -473,7 +473,7 @@ impl<'a> SerializableFrame<'a> for ConnectionCloseFrame<'a> { } fn put_contents(&self, buf: &mut impl MutBufOerExt) { - buf.put_u8(self.code.clone() as u8); + buf.put_u8(self.code as u8); buf.put_var_octet_string(self.message.as_bytes()); } } @@ -641,7 +641,7 @@ impl<'a> SerializableFrame<'a> for StreamCloseFrame<'a> { fn put_contents(&self, buf: &mut impl MutBufOerExt) { buf.put_var_uint(self.stream_id); - buf.put_u8(self.code.clone() as u8); + buf.put_u8(self.code as u8); buf.put_var_octet_string(self.message.as_bytes()); } }