All storage factories are generic now

This commit is contained in:
Igor Katson 2024-05-01 22:14:34 +01:00
parent e4adfa569a
commit 5027d8ccd1
12 changed files with 88 additions and 52 deletions

View file

@ -5,8 +5,9 @@ use tokio::{io::AsyncReadExt, time::timeout};
use tracing::info;
use crate::{
create_torrent, storage::example::InMemoryExampleStorageFactory, AddTorrent,
CreateTorrentOptions, Session,
create_torrent,
storage::{example::InMemoryExampleStorageFactory, StorageFactoryExt},
AddTorrent, CreateTorrentOptions, Session,
};
use super::test_util::create_default_random_dir_with_torrents;
@ -85,7 +86,7 @@ async fn e2e_stream() -> anyhow::Result<()> {
AddTorrent::from_bytes(torrent.as_bytes()?),
Some(crate::AddTorrentOptions {
paused: false,
storage_factory: Some(Box::new(InMemoryExampleStorageFactory {})),
storage_factory: Some(InMemoryExampleStorageFactory::default().boxed()),
initial_peers: Some(vec![peer]),
..Default::default()
}),