Skip to content

Commit 23c2d58

Browse files
committed
Store downloader in a variable
1 parent ac51f3d commit 23c2d58

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/transfer.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ async fn main() -> anyhow::Result<()> {
5656
let abs_path = std::path::absolute(filename)?;
5757
let ticket: BlobTicket = ticket.parse()?;
5858

59-
println!("Starting download.");
60-
6159
// For receiving files, we create a "downloader" that allows us to fetch files
6260
// from other nodes via iroh connections
63-
store
64-
.downloader(&endpoint)
61+
let downloader = store.downloader(&endpoint);
62+
63+
println!("Starting download.");
64+
65+
downloader
6566
.download(ticket.hash(), Some(ticket.node_addr().node_id))
6667
.await?;
6768

0 commit comments

Comments
 (0)