diff --git a/src/network/message.rs b/src/network/message.rs index cb4674be..fc421476 100644 --- a/src/network/message.rs +++ b/src/network/message.rs @@ -35,7 +35,7 @@ use consensus::encode::MAX_VEC_SIZE; /// Serializer for command string #[derive(PartialEq, Eq, Clone, Debug)] -pub struct CommandString(pub Cow<'static, str>); +pub struct CommandString(Cow<'static, str>); impl fmt::Display for CommandString { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -55,6 +55,12 @@ impl From for CommandString { } } +impl AsRef for CommandString { + fn as_ref(&self) -> &str { + self.0.as_ref() + } +} + impl Encodable for CommandString { #[inline] fn consensus_encode(