mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
aquatic_ws: use [u8; 20] for info hash etc, fix deserialization
This commit is contained in:
parent
6b0f2463b6
commit
18c4a51b74
2 changed files with 38 additions and 11 deletions
|
|
@ -10,7 +10,7 @@ use deserialize::*;
|
|||
#[serde(transparent)]
|
||||
pub struct PeerId(
|
||||
#[serde(deserialize_with = "deserialize_20_bytes")]
|
||||
pub String
|
||||
pub [u8; 20]
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ pub struct PeerId(
|
|||
#[serde(transparent)]
|
||||
pub struct InfoHash(
|
||||
#[serde(deserialize_with = "deserialize_20_bytes")]
|
||||
pub String
|
||||
pub [u8; 20]
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ pub struct InfoHash(
|
|||
#[serde(transparent)]
|
||||
pub struct OfferId(
|
||||
#[serde(deserialize_with = "deserialize_20_bytes")]
|
||||
pub String
|
||||
pub [u8; 20]
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue