proxmox::test: rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-02-23 14:34:22 +01:00
parent 944ea1e8b7
commit 866ec28116
2 changed files with 5 additions and 13 deletions

View File

@ -9,9 +9,7 @@ pub struct AsyncBlockingReader<R> {
impl<W> AsyncBlockingReader<W> { impl<W> AsyncBlockingReader<W> {
pub fn new(inner: W) -> Self { pub fn new(inner: W) -> Self {
Self { Self { inner }
inner
}
} }
pub fn inner(&self) -> &W { pub fn inner(&self) -> &W {
@ -26,10 +24,7 @@ pub struct AsyncBlockingWriter<W> {
impl<W> AsyncBlockingWriter<W> { impl<W> AsyncBlockingWriter<W> {
pub fn new(inner: W) -> Self { pub fn new(inner: W) -> Self {
Self { Self { inner, seek_pos: 0 }
inner,
seek_pos: 0,
}
} }
pub fn inner(&self) -> &W { pub fn inner(&self) -> &W {
@ -85,10 +80,7 @@ impl<R: std::io::Seek + Unpin> AsyncSeek for AsyncBlockingWriter<R> {
Ok(()) Ok(())
} }
fn poll_complete( fn poll_complete(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<std::io::Result<u64>> {
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<std::io::Result<u64>> {
let this = Pin::get_mut(self); let this = Pin::get_mut(self);
Poll::Ready(Ok(this.seek_pos)) Poll::Ready(Ok(this.seek_pos))
} }

View File

@ -12,7 +12,7 @@ where
unsafe { unsafe {
match Pin::new_unchecked(&mut fut).poll(&mut cx) { match Pin::new_unchecked(&mut fut).poll(&mut cx) {
Poll::Pending => Err(crate::sys::error::io_err_other( Poll::Pending => Err(crate::sys::error::io_err_other(
"got Poll::Pending synchronous context", "got Poll::Pending synchronous context",
)), )),
Poll::Ready(r) => r, Poll::Ready(r) => r,
} }
@ -20,7 +20,7 @@ where
} }
const WAKER_VTABLE: std::task::RawWakerVTable = const WAKER_VTABLE: std::task::RawWakerVTable =
std::task::RawWakerVTable::new(forbid_clone, forbid_wake, forbid_wake, ignore_drop); std::task::RawWakerVTable::new(forbid_clone, forbid_wake, forbid_wake, ignore_drop);
unsafe fn forbid_clone(_: *const ()) -> std::task::RawWaker { unsafe fn forbid_clone(_: *const ()) -> std::task::RawWaker {
panic!("tried to clone waker for synchronous task"); panic!("tried to clone waker for synchronous task");