diff --git a/crates/librqbit/src/storage/mod.rs b/crates/librqbit/src/storage/mod.rs index 738d376..b4332e2 100644 --- a/crates/librqbit/src/storage/mod.rs +++ b/crates/librqbit/src/storage/mod.rs @@ -28,25 +28,3 @@ pub trait TorrentStorage: Send + Sync { None } } - -impl TorrentStorage for Box { - fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> { - (**self).pread_exact(file_id, offset, buf) - } - - fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> { - (**self).pwrite_all(file_id, offset, buf) - } - - fn remove_file(&self, file_id: usize, filename: &Path) -> anyhow::Result<()> { - (**self).remove_file(file_id, filename) - } - - fn ensure_file_length(&self, file_id: usize, length: u64) -> anyhow::Result<()> { - (**self).ensure_file_length(file_id, length) - } - - fn take(&self) -> anyhow::Result> { - (**self).take() - } -} diff --git a/crates/librqbit/src/torrent_state/initializing.rs b/crates/librqbit/src/torrent_state/initializing.rs index c26a432..7944b6b 100644 --- a/crates/librqbit/src/torrent_state/initializing.rs +++ b/crates/librqbit/src/torrent_state/initializing.rs @@ -41,7 +41,7 @@ impl TorrentStateInitializing { let initial_check_results = self.meta.spawner.spawn_block_in_place(|| { FileOps::new( &self.meta.info, - &files, + &*files, &self.meta.file_infos, &self.meta.lengths, ) diff --git a/crates/librqbit/src/torrent_state/live/mod.rs b/crates/librqbit/src/torrent_state/live/mod.rs index 1001451..d7e4d9b 100644 --- a/crates/librqbit/src/torrent_state/live/mod.rs +++ b/crates/librqbit/src/torrent_state/live/mod.rs @@ -491,7 +491,7 @@ impl TorrentStateLive { pub(crate) fn file_ops(&self) -> FileOps<'_> { FileOps::new( &self.meta.info, - &self.files, + &*self.files, &self.meta().file_infos, &self.lengths, ) diff --git a/crates/librqbit/src/torrent_state/streaming.rs b/crates/librqbit/src/torrent_state/streaming.rs index 78f4ed1..593c57f 100644 --- a/crates/librqbit/src/torrent_state/streaming.rs +++ b/crates/librqbit/src/torrent_state/streaming.rs @@ -303,8 +303,8 @@ impl ManagedTorrent { { self.with_state(|s| { let files = match s { - crate::ManagedTorrentState::Paused(p) => &p.files, - crate::ManagedTorrentState::Live(l) => &l.files, + crate::ManagedTorrentState::Paused(p) => &*p.files, + crate::ManagedTorrentState::Live(l) => &*l.files, _ => anyhow::bail!("invalid state"), }; let fi = self