mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-02 02:00:03 +00:00
Rename AsyncExtracter::write
to feed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
432376224f
commit
8a812c8d22
2 changed files with 6 additions and 6 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue