diff --git a/src/client.rs b/src/client.rs index 2c749fb..29262ae 100644 --- a/src/client.rs +++ b/src/client.rs @@ -333,7 +333,7 @@ impl Client { /// The core `SUBSCRIBE` logic, used by misc subscribe fns async fn subscribe_cmd(&mut self, channels: &[String]) -> crate::Result<()> { // Convert the `Subscribe` command into a frame - let frame = Subscribe::new(&channels).into_frame(); + let frame = Subscribe::new(channels.to_vec()).into_frame(); debug!(request = ?frame); diff --git a/src/cmd/subscribe.rs b/src/cmd/subscribe.rs index 4b339c4..5102598 100644 --- a/src/cmd/subscribe.rs +++ b/src/cmd/subscribe.rs @@ -34,10 +34,8 @@ type Messages = Pin + Send>>; impl Subscribe { /// Creates a new `Subscribe` command to listen on the specified channels. - pub(crate) fn new(channels: &[String]) -> Subscribe { - Subscribe { - channels: channels.to_vec(), - } + pub(crate) fn new(channels: Vec) -> Subscribe { + Subscribe {channels} } /// Parse a `Subscribe` instance from a received frame. @@ -288,7 +286,7 @@ impl Unsubscribe { } } - /// Parse a `Unsubscribe` instance from a received frame. + /// Parse an `Unsubscribe` instance from a received frame. /// /// The `Parse` argument provides a cursor-like API to read fields from the /// `Frame`. At this point, the entire frame has already been received from