Skip to content

Commit 26bb664

Browse files
committed
Use is_empty() vs len() > 0
1 parent 72f34aa commit 26bb664

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

communication/src/allocator/zero_copy/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<A: Allocate> Allocate for TcpAllocator<A> {
261261

262262
// We expect that `bytes` contains an integral number of messages.
263263
// No splitting occurs across allocations.
264-
while bytes.len() > 0 {
264+
while !bytes.is_empty() {
265265

266266
if let Some(header) = MessageHeader::try_read(&bytes[..]) {
267267

communication/src/allocator/zero_copy/allocator_process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl Allocate for ProcessAllocator {
188188

189189
// We expect that `bytes` contains an integral number of messages.
190190
// No splitting occurs across allocations.
191-
while bytes.len() > 0 {
191+
while !bytes.is_empty() {
192192

193193
if let Some(header) = MessageHeader::try_read(&bytes[..]) {
194194

0 commit comments

Comments
 (0)