change a usage related to ownership

This commit is contained in:
Ting Sun
2023-03-22 04:17:24 +08:00
committed by Carl Lerche
parent 151a653e69
commit dcaa67388b
2 changed files with 4 additions and 6 deletions

View File

@@ -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);

View File

@@ -34,10 +34,8 @@ type Messages = Pin<Box<dyn Stream<Item = Bytes> + 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<String>) -> 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