diff --git a/src/lib.rs b/src/lib.rs index b94de83..db7b421 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,24 +31,6 @@ pub struct Header { pub value: Cow<'static, str>, } -impl From for Header { - fn from(header: service_protocol::messages::Header) -> Self { - Self { - key: Cow::Owned(header.key), - value: Cow::Owned(header.value), - } - } -} - -impl From
for service_protocol::messages::Header { - fn from(header: Header) -> Self { - Self { - key: header.key.into(), - value: header.value.into(), - } - } -} - #[derive(Debug)] pub struct ResponseHead { pub status_code: u16, diff --git a/src/service_protocol/messages.rs b/src/service_protocol/messages.rs index 72bd0ce..3ce2464 100644 --- a/src/service_protocol/messages.rs +++ b/src/service_protocol/messages.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use crate::service_protocol::messages::get_state_keys_entry_message::StateKeys; use crate::service_protocol::{MessageHeader, MessageType}; use crate::vm::errors::{ @@ -455,6 +457,24 @@ impl From for crate::TerminalFailure { } } +impl From
for crate::Header { + fn from(header: Header) -> Self { + Self { + key: Cow::Owned(header.key), + value: Cow::Owned(header.value), + } + } +} + +impl From for Header { + fn from(header: crate::Header) -> Self { + Self { + key: header.key.into(), + value: header.value.into(), + } + } +} + // --- Completion parsing #[derive(Debug)]