Skip to content

Commit 4df0761

Browse files
committed
chore: polishing
1 parent 5a49f0d commit 4df0761

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

crates/http/src/connection/http_connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ where
158158
};
159159

160160
let header = Message::<_, T::Data>::Header((ResponseHead::from_parts(header_parts, ()), payload_size));
161-
if !payload_size.is_empty() {
161+
if payload_size.is_not_empty() {
162162
self.framed_write.feed(header).await?;
163163
} else {
164164
// using send instead of feed, because we want to flush the underlying IO

crates/http/src/protocol/message.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ impl PayloadSize {
6868
pub fn is_empty(&self) -> bool {
6969
matches!(self, PayloadSize::Empty)
7070
}
71+
72+
#[inline]
73+
pub fn is_not_empty(&self) -> bool {
74+
!self.is_empty()
75+
}
7176
}
7277

7378
impl<T> Message<T> {

0 commit comments

Comments
 (0)