Initial private torrents support

This commit is contained in:
Igor Katson 2025-01-13 15:47:13 +00:00
parent bc5e23bf6d
commit 8efd77fce2
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
7 changed files with 50 additions and 16 deletions

View file

@ -218,11 +218,8 @@ impl<'ser, W: std::io::Write> Serializer for &'ser mut BencodeSerializer<W> {
type SerializeStruct = SerializeStruct<'ser, W>;
type SerializeStructVariant = Impossible<(), SerError>;
fn serialize_bool(self, _: bool) -> Result<Self::Ok, Self::Error> {
Err(SerError::custom_with_ser(
"bencode doesn't support booleans",
self,
))
fn serialize_bool(self, value: bool) -> Result<Self::Ok, Self::Error> {
self.write_number(if value { 1 } else { 0 })
}
fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error> {