switch packet buffer to smallvec

This commit is contained in:
2023-06-20 13:58:23 +02:00
parent 813e1af396
commit e77fa730dd
6 changed files with 14 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ use std::fmt::Debug;
use bytemuck::{Pod, Zeroable};
use eyre::eyre;
use serde::Serialize;
use smallvec::SmallVec;
use tokio::{
io::{AsyncReadExt, AsyncWriteExt},
net::tcp::{ReadHalf, WriteHalf},
@@ -79,7 +80,7 @@ pub struct Header {
#[derive(Serialize, Default, Clone)]
pub struct Packet {
pub header: Header,
pub data: Vec<u8>,
pub data: SmallVec<[u8; 8]>,
}
impl Packet {