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
|
|
@ -4,7 +4,7 @@ use std::{
|
|||
net::{Ipv4Addr, SocketAddrV4},
|
||||
};
|
||||
|
||||
use bencode::{ByteBuf, ByteString};
|
||||
use bencode::{ByteBuf, ByteBufOwned};
|
||||
use clone_to_owned::CloneToOwned;
|
||||
use librqbit_core::hash_id::Id20;
|
||||
use serde::{
|
||||
|
|
@ -356,7 +356,7 @@ pub struct Message<BufT> {
|
|||
pub ip: Option<SocketAddrV4>,
|
||||
}
|
||||
|
||||
impl Message<ByteString> {
|
||||
impl Message<ByteBufOwned> {
|
||||
// This implies that the transaction id was generated by us.
|
||||
pub fn get_our_transaction_id(&self) -> Option<u16> {
|
||||
if self.transaction_id.len() != 2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue