diff --git a/src/helpers.rs b/src/helpers.rs index bc7ce7c8..600b5755 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -74,7 +74,7 @@ pub async fn download_and_extract, const N: usize>( let mut extracter = AsyncExtracter::new(path, fmt, desired_outputs); while let Some(res) = bytes_stream.next().await { - extracter.write(res?).await?; + extracter.feed(res?).await?; } extracter.done().await?; diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 8f0b2e5e..066304c8 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -104,9 +104,9 @@ impl AsyncExtracterInner { Ok(()) } - /// Upon error, this writer shall not be reused. + /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. - async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { + async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { if self.tx.send(Content::Data(bytes)).await.is_err() { // task failed Err(Self::wait(&mut self.handle).await.expect_err( @@ -193,10 +193,10 @@ impl AsyncExtracter { Self(guard(inner, AsyncExtracterInner::abort)) } - /// Upon error, this writer shall not be reused. + /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. - pub async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { - self.0.write(bytes).await + pub async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { + self.0.feed(bytes).await } pub async fn done(self) -> Result<(), BinstallError> {