Skip to content

Commit

Permalink
Addressed reviewer comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Rapp <HolgerRapp@gmx.net>
  • Loading branch information
SirVer committed Dec 8, 2023
1 parent 5664021 commit 7e97085
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions zvt/src/sequences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{encoding, ZvtEnum, ZvtParser, ZvtSerializer};
use anyhow::Result;
use async_stream::try_stream;
use futures::Stream;
use log::{log_enabled, debug, Level::Debug};
use log::debug;
use std::boxed::Box;
use std::marker::Unpin;
use std::pin::Pin;
Expand All @@ -25,10 +25,7 @@ pub async fn read_packet_async(src: &mut Pin<&mut impl AsyncReadExt>) -> Result<
let start = buf.len();
buf.resize(start + len, 0);
src.read_exact(&mut buf[start..]).await?;

if log_enabled!(Debug) {
debug!("RX: {}", pretty_hex::simple_hex(&buf));
}
debug!("RX: {}", pretty_hex::simple_hex(&buf));

Ok(buf.to_vec())
}
Expand All @@ -42,9 +39,7 @@ where
encoding::Default: encoding::Encoding<T>,
{
let bytes = p.zvt_serialize();
if log_enabled!(Debug) {
debug!("TX: {}", pretty_hex::simple_hex(&bytes));
}
debug!("TX: {}", pretty_hex::simple_hex(&bytes));
drain.write_all(&bytes).await
}

Expand Down

0 comments on commit 7e97085

Please sign in to comment.