mirror of
https://github.com/neondatabase/neon.git
synced 2026-07-07 06:00:38 +00:00
WIP: page_cache_priming_writer: clippy
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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<_>>()
|
||||
);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user