some internal combinator-influenced api cleanup

The download methods used to take the destination by value
and return them again, since this was required when using
combinators before we had `async fn`.
But this is just an ugly left-over now.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2020-06-12 11:46:42 +02:00
parent 8e6e18b77c
commit 3d571d5509
5 changed files with 23 additions and 22 deletions

View File

@ -466,7 +466,7 @@ impl HttpClient {
&mut self,
path: &str,
output: &mut (dyn Write + Send),
) -> Result<(), Error> {
) -> Result<(), Error> {
let mut req = Self::request_builder(&self.server, "GET", path, None).unwrap();
let client = self.client.clone();
@ -707,7 +707,7 @@ impl H2Client {
path: &str,
param: Option<Value>,
mut output: W,
) -> Result<W, Error> {
) -> Result<(), Error> {
let request = Self::request_builder("localhost", "GET", path, param, None).unwrap();
let response_future = self.send_request(request, None).await?;
@ -727,7 +727,7 @@ impl H2Client {
output.write_all(&chunk)?;
}
Ok(output)
Ok(())
}
pub async fn upload(