aquatic_ws: use [u8; 20] for info hash etc, fix deserialization

This commit is contained in:
Joakim Frostegård 2020-05-11 23:20:58 +02:00
parent 6b0f2463b6
commit 18c4a51b74
2 changed files with 38 additions and 11 deletions

View file

@ -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]
);