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

@ -44,8 +44,8 @@ async fn run() -> Result<(), Error> {
let mut bytes = 0;
for _ in 0..100 {
let writer = DummyWriter { bytes: 0 };
let writer = client.speedtest(writer).await?;
let mut writer = DummyWriter { bytes: 0 };
client.speedtest(&mut writer).await?;
println!("Received {} bytes", writer.bytes);
bytes += writer.bytes;
}

View File

@ -2199,7 +2199,7 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
true,
).await?;
let tmpfile = std::fs::OpenOptions::new()
let mut tmpfile = std::fs::OpenOptions::new()
.write(true)
.read(true)
.custom_flags(libc::O_TMPFILE)
@ -2216,7 +2216,7 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
Arc::new(BufferedDynamicReadAt::new(reader));
let decoder = proxmox_backup::pxar::fuse::Accessor::new(reader, archive_size).await?;
let tmpfile = client.download(CATALOG_NAME, tmpfile).await?;
client.download(CATALOG_NAME, &mut tmpfile).await?;
let index = DynamicIndexReader::new(tmpfile)
.map_err(|err| format_err!("unable to read catalog index - {}", err))?;