mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 13:38:43 +00:00
Fix codestyle in async_extracter
Use consistent codestyle for specifing trait bounds. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
53bf76104b
commit
db22d7d041
1 changed files with 11 additions and 12 deletions
|
@ -38,11 +38,9 @@ where
|
||||||
block_in_place(move || f(readable))
|
block_in_place(move || f(readable))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn extract_bin<E>(
|
pub async fn extract_bin<S, E>(stream: S, path: &Path) -> Result<(), BinstallError>
|
||||||
stream: impl Stream<Item = Result<Bytes, E>> + Unpin,
|
|
||||||
path: &Path,
|
|
||||||
) -> Result<(), BinstallError>
|
|
||||||
where
|
where
|
||||||
|
S: Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
||||||
BinstallError: From<E>,
|
BinstallError: From<E>,
|
||||||
{
|
{
|
||||||
extract_impl(stream, move |mut reader| {
|
extract_impl(stream, move |mut reader| {
|
||||||
|
@ -67,11 +65,9 @@ where
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn extract_zip<E>(
|
pub async fn extract_zip<S, E>(stream: S, path: &Path) -> Result<(), BinstallError>
|
||||||
stream: impl Stream<Item = Result<Bytes, E>> + Unpin,
|
|
||||||
path: &Path,
|
|
||||||
) -> Result<(), BinstallError>
|
|
||||||
where
|
where
|
||||||
|
S: Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
||||||
BinstallError: From<E>,
|
BinstallError: From<E>,
|
||||||
{
|
{
|
||||||
extract_impl(stream, move |mut reader| {
|
extract_impl(stream, move |mut reader| {
|
||||||
|
@ -89,12 +85,13 @@ where
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn extract_tar_based_stream<E>(
|
pub async fn extract_tar_based_stream<S, E>(
|
||||||
stream: impl Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
stream: S,
|
||||||
path: &Path,
|
path: &Path,
|
||||||
fmt: TarBasedFmt,
|
fmt: TarBasedFmt,
|
||||||
) -> Result<(), BinstallError>
|
) -> Result<(), BinstallError>
|
||||||
where
|
where
|
||||||
|
S: Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
||||||
BinstallError: From<E>,
|
BinstallError: From<E>,
|
||||||
{
|
{
|
||||||
extract_impl(stream, move |reader| {
|
extract_impl(stream, move |reader| {
|
||||||
|
@ -121,12 +118,14 @@ impl<V: TarEntriesVisitor> TarEntriesVisitor for &mut V {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn extract_tar_based_stream_and_visit<V: TarEntriesVisitor + Debug + Send + 'static, E>(
|
pub async fn extract_tar_based_stream_and_visit<S, V, E>(
|
||||||
stream: impl Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
stream: S,
|
||||||
fmt: TarBasedFmt,
|
fmt: TarBasedFmt,
|
||||||
mut visitor: V,
|
mut visitor: V,
|
||||||
) -> Result<V, BinstallError>
|
) -> Result<V, BinstallError>
|
||||||
where
|
where
|
||||||
|
S: Stream<Item = Result<Bytes, E>> + Unpin + 'static,
|
||||||
|
V: TarEntriesVisitor + Debug + Send + 'static,
|
||||||
BinstallError: From<E>,
|
BinstallError: From<E>,
|
||||||
{
|
{
|
||||||
extract_impl(stream, move |reader| {
|
extract_impl(stream, move |reader| {
|
||||||
|
|
Loading…
Add table
Reference in a new issue