Box<[u8]> instead of Vec<u8> for ByteBufOwned
This commit is contained in:
parent
d9ec702f59
commit
deee41cd93
23 changed files with 106 additions and 124 deletions
|
|
@ -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