WIP: page_cache_priming_writer: clippy

This commit is contained in:
Christian Schwarz
2024-03-14 17:19:15 +00:00
parent a1f4eb2815
commit f0a67c4071
4 changed files with 6 additions and 3 deletions

View File

@@ -202,7 +202,7 @@ impl EphemeralFile {
}
// Write the payload
self.file.write_all_borrowed(&srcbuf, ctx).await?;
self.file.write_all_borrowed(srcbuf, ctx).await?;
Ok(pos)
}

View File

@@ -21,6 +21,7 @@ impl<W> Writer<W> {
}
/// Returns the wrapped `VirtualFile` object as well as the number
/// of bytes that were written to it through this object.
#[allow(dead_code)]
pub fn into_inner(self) -> (u64, W) {
(self.bytes_amount, self.dst)
}

View File

@@ -73,6 +73,7 @@ where
.as_zero_padded_slice()
}
#[allow(dead_code)]
pub async fn flush_and_into_inner(mut self, ctx: &RequestContext) -> std::io::Result<W> {
self.flush(ctx).await?;
let Self { buf, writer } = self;
@@ -215,7 +216,7 @@ impl OwnedAsyncWriter for Vec<u8> {
buf: &[u8],
_ctx: &RequestContext,
) -> std::io::Result<usize> {
self.extend_from_slice(&buf[..]);
self.extend_from_slice(buf);
Ok(buf.len())
}
}
@@ -341,7 +342,7 @@ mod tests {
let expect: &[&[u8]] = &[b"ab", b"cd", b"ef", b"gh", b"ij", b"kl", b"mn", b"o"];
expect
}
.into_iter()
.iter()
.map(|v| v[..].to_vec())
.collect::<Vec<_>>()
);

View File

@@ -54,6 +54,7 @@ impl<const N: usize> Buf<N> {
}
}
/// SAFETY: the Box<> has a stable location in memory.
unsafe impl<const N: usize> tokio_epoll_uring::IoBuf for Buf<N> {
fn stable_ptr(&self) -> *const u8 {
self.allocation.as_ptr()