From 9498c45d1291c0b2343339bad624d0dc0ca0a934 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Wed, 15 Feb 2023 22:04:42 +0100 Subject: Use Cow for Pkt --- src/share.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/share.rs') diff --git a/src/share.rs b/src/share.rs index e0d2d2b..ad63290 100644 --- a/src/share.rs +++ b/src/share.rs @@ -1,5 +1,5 @@ use super::*; -use std::{collections::HashMap, io, sync::Arc, time::Duration}; +use std::{borrow::Cow, collections::HashMap, io, sync::Arc, time::Duration}; use tokio::{ sync::{mpsc, watch, Mutex, RwLock}, task::JoinSet, @@ -93,7 +93,7 @@ pub async fn new( Pkt { chan: 0, unrel: false, - data: &[CtlType::Ping as u8], + data: Cow::Borrowed(&[CtlType::Ping as u8]), }, ) .await -- cgit v1.2.3