From f7769b049a0eacf008c1ba058bff3d1001604c72 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 25 May 2020 15:01:57 -0500 Subject: [PATCH] FileSink doesn't need chunk_size --- src/lib.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e17451d..7ee965e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -92,7 +92,6 @@ impl FileStream { struct FileSink { file: Option, fut: Option>>>, - chunk_size: u64, closing: bool, _error: PhantomData, } @@ -102,7 +101,6 @@ impl FileSink { FileSink { file: Some(file), fut: None, - chunk_size: 0, closing: false, _error: PhantomData, } @@ -250,7 +248,6 @@ where Poll::Ready(Ok(file)) => { self.fut.take(); self.file = Some(file); - self.chunk_size = 0; Poll::Ready(Ok(())) } @@ -264,7 +261,6 @@ where fn start_send(mut self: Pin<&mut Self>, item: Bytes) -> Result<(), Self::Error> { let mut file = self.file.take().expect("Use after completion"); - self.chunk_size = item.len() as u64; self.fut = Some( actix_threadpool::run(move || { @@ -287,7 +283,6 @@ where match Pin::new(fut).poll(cx) { Poll::Ready(Ok(file)) => { self.file = Some(file); - self.chunk_size = 0; } Poll::Ready(Err(e)) => return Poll::Ready(Err(Error::from(e).into())), Poll::Pending => return Poll::Pending,