diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index e1448776..2a2a42dd 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -38,11 +38,9 @@ where block_in_place(move || f(readable)) } -pub async fn extract_bin( - stream: impl Stream> + Unpin, - path: &Path, -) -> Result<(), BinstallError> +pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |mut reader| { @@ -67,11 +65,9 @@ where .await } -pub async fn extract_zip( - stream: impl Stream> + Unpin, - path: &Path, -) -> Result<(), BinstallError> +pub async fn extract_zip(stream: S, path: &Path) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |mut reader| { @@ -89,12 +85,13 @@ where .await } -pub async fn extract_tar_based_stream( - stream: impl Stream> + Unpin + 'static, +pub async fn extract_tar_based_stream( + stream: S, path: &Path, fmt: TarBasedFmt, ) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |reader| { @@ -121,12 +118,14 @@ impl TarEntriesVisitor for &mut V { } } -pub async fn extract_tar_based_stream_and_visit( - stream: impl Stream> + Unpin + 'static, +pub async fn extract_tar_based_stream_and_visit( + stream: S, fmt: TarBasedFmt, mut visitor: V, ) -> Result where + S: Stream> + Unpin + 'static, + V: TarEntriesVisitor + Debug + Send + 'static, BinstallError: From, { extract_impl(stream, move |reader| {