aquatic_http: deserialize AnnounceRequest.compact to bool

This commit is contained in:
Joakim Frostegård 2020-07-02 15:51:45 +02:00
parent 6fc4b693cd
commit ff4fcc163d
3 changed files with 40 additions and 3 deletions

View file

@ -74,8 +74,11 @@ pub struct AnnounceRequest {
pub bytes_left: usize,
#[serde(default)]
pub event: AnnounceEvent,
/// FIXME: number: 0 or 1 to bool
pub compact: u8,
/// FIXME: is optional, so should default to something, maybe `true`
#[serde(
deserialize_with = "deserialize_bool_from_number"
)]
pub compact: bool,
/// Requested number of peers to return
pub numwant: usize,
}