remove impl for box dyn storage

This commit is contained in:
Igor Katson 2024-04-30 09:11:23 +01:00
parent dc137c075f
commit 3e37b4698f
4 changed files with 4 additions and 26 deletions

View file

@ -28,25 +28,3 @@ pub trait TorrentStorage: Send + Sync {
None
}
}
impl TorrentStorage for Box<dyn TorrentStorage> {
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<Box<dyn TorrentStorage>> {
(**self).take()
}
}