From b0ba9d902bfedd8a26e0420c58dbb054eeaf3a8f Mon Sep 17 00:00:00 2001 From: coldWater Date: Wed, 13 Nov 2024 14:03:34 +0800 Subject: [PATCH] fix Signed-off-by: coldWater --- src/common/base/src/base/dma.rs | 2 +- src/query/service/src/spillers/spiller.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/base/src/base/dma.rs b/src/common/base/src/base/dma.rs index 110f5fd4d0dc..3e5a09daba1e 100644 --- a/src/common/base/src/base/dma.rs +++ b/src/common/base/src/base/dma.rs @@ -706,7 +706,7 @@ mod tests { #[test] fn test_dma_buffer_to_bytes() { - let want = (0..10_u8).into_iter().collect::>(); + let want = (0..10_u8).collect::>(); let alloc = DmaAllocator::new(Alignment::new(4096).unwrap()); let mut buf = DmaBuffer::with_capacity_in(3000, alloc); buf.extend_from_slice(&want); diff --git a/src/query/service/src/spillers/spiller.rs b/src/query/service/src/spillers/spiller.rs index 3f789bde020d..e545d6c89ce0 100644 --- a/src/query/service/src/spillers/spiller.rs +++ b/src/query/service/src/spillers/spiller.rs @@ -20,7 +20,6 @@ use std::ops::Range; use std::sync::Arc; use std::time::Instant; -use bytes::Bytes; use databend_common_base::base::dma_buffer_to_bytes; use databend_common_base::base::dma_read_file_range; use databend_common_base::base::Alignment; @@ -410,7 +409,7 @@ impl Spiller { let buf = buf .into_data() .into_iter() - .map(|x| Bytes::from(dma_buffer_to_bytes(x))) + .map(dma_buffer_to_bytes) .collect::(); let written = buf.len(); writer.write(buf).await?;