Box<[u8]> instead of Vec<u8> for ByteBufOwned

This commit is contained in:
Igor Katson 2024-03-29 11:00:58 +00:00
parent d9ec702f59
commit deee41cd93
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
23 changed files with 106 additions and 124 deletions

View file

@ -13,7 +13,7 @@ use std::time::Duration;
use anyhow::bail;
use anyhow::Context;
use buffers::ByteString;
use buffers::ByteBufOwned;
use futures::future::BoxFuture;
use futures::FutureExt;
use librqbit_core::hash_id::Id20;
@ -78,7 +78,7 @@ pub(crate) struct ManagedTorrentOptions {
}
pub struct ManagedTorrentInfo {
pub info: TorrentMetaV1Info<ByteString>,
pub info: TorrentMetaV1Info<ByteBufOwned>,
pub info_hash: Id20,
pub out_dir: PathBuf,
pub(crate) spawner: BlockingSpawner,
@ -410,7 +410,7 @@ impl ManagedTorrent {
}
pub struct ManagedTorrentBuilder {
info: TorrentMetaV1Info<ByteString>,
info: TorrentMetaV1Info<ByteBufOwned>,
info_hash: Id20,
output_folder: PathBuf,
force_tracker_interval: Option<Duration>,
@ -425,7 +425,7 @@ pub struct ManagedTorrentBuilder {
impl ManagedTorrentBuilder {
pub fn new<P: AsRef<Path>>(
info: TorrentMetaV1Info<ByteString>,
info: TorrentMetaV1Info<ByteBufOwned>,
info_hash: Id20,
output_folder: P,
) -> Self {