Box<[u8]> instead of Vec<u8> for ByteBufOwned
This commit is contained in:
parent
3cdf6d4cfc
commit
fa05fe8376
24 changed files with 118 additions and 109 deletions
|
|
@ -18,16 +18,16 @@ sha1-rust = ["bencode/sha1-rust"]
|
|||
|
||||
[dependencies]
|
||||
tracing = "0.1.40"
|
||||
tokio = {version = "1", features = ["rt-multi-thread", "macros", "time"]}
|
||||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
|
||||
hex = "0.4"
|
||||
anyhow = "1"
|
||||
url = "2"
|
||||
uuid = {version = "1", features = ["v4"]}
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
parking_lot = "0.12"
|
||||
serde = {version = "1", features=["derive"]}
|
||||
buffers = {path="../buffers", package="librqbit-buffers", version = "2.2.1"}
|
||||
bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"}
|
||||
clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"}
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
buffers = { path = "../buffers", package = "librqbit-buffers", version = "2.2.1" }
|
||||
bencode = { path = "../bencode", default-features = false, package = "librqbit-bencode", version = "2.2.2" }
|
||||
clone_to_owned = { path = "../clone_to_owned", package = "librqbit-clone-to-owned", version = "2.2.1" }
|
||||
itertools = "0.12"
|
||||
directories = "5"
|
||||
tokio-util = "0.7.10"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::{iter::once, path::PathBuf};
|
|||
|
||||
use anyhow::Context;
|
||||
use bencode::BencodeDeserializer;
|
||||
use buffers::{ByteBuf, ByteString};
|
||||
use buffers::{ByteBuf, ByteBufOwned};
|
||||
use clone_to_owned::CloneToOwned;
|
||||
use itertools::Either;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::hash_id::Id20;
|
||||
|
||||
pub type TorrentMetaV1Borrowed<'a> = TorrentMetaV1<ByteBuf<'a>>;
|
||||
pub type TorrentMetaV1Owned = TorrentMetaV1<ByteString>;
|
||||
pub type TorrentMetaV1Owned = TorrentMetaV1<ByteBufOwned>;
|
||||
|
||||
/// Parse torrent metainfo from bytes.
|
||||
pub fn torrent_from_bytes<'de, ByteBuf: Deserialize<'de>>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue