update callback to take collection by ref

This commit is contained in:
Floris Bruynooghe
2023-02-09 10:02:18 +01:00
parent 05ddc13054
commit 3734fc25a7

View File

@@ -31,7 +31,6 @@ use crate::qr::Qr;
use anyhow::{anyhow, bail, ensure, format_err, Context as _, Result};
use async_channel::Receiver;
use futures_lite::StreamExt;
use sendme::blobs::Collection;
use sendme::get::{DataStream, Options};
use sendme::protocol::AuthToken;
use sendme::provider::{DataSource, Event, Provider, Ticket};
@@ -251,7 +250,7 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
ticket.token,
opts,
on_connected,
on_collection,
|_collection| async { Ok(()) },
on_blob,
)
.await
@@ -280,12 +279,6 @@ async fn on_connected() -> Result<()> {
Ok(())
}
/// Get callback when a collection is received from the provider.
#[allow(clippy::unused_async)]
async fn on_collection(_collection: Collection) -> Result<()> {
Ok(())
}
/// Get callback when a blob is received from the provider.
async fn on_blob(
context: &Context,