can now decode torrent as JSON in the HTTP API
This commit is contained in:
parent
52beec9296
commit
04cfe9fc6b
3 changed files with 61 additions and 3 deletions
|
|
@ -42,6 +42,9 @@ impl<'a> std::fmt::Display for HexBytes<'a> {
|
|||
}
|
||||
|
||||
fn debug_bytes(b: &[u8], f: &mut std::fmt::Formatter<'_>, debug_strings: bool) -> std::fmt::Result {
|
||||
if b.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
if b.iter().all(|b| *b == 0) {
|
||||
return write!(f, "<{} bytes, all zeroes>", b.len());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue