From 279a39ba76cdbe9fb3b5885c25bf3a50535400aa Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Fri, 5 Jan 2024 19:34:53 -0800 Subject: [PATCH] Fix `imdl torrent dump` dictionary formatting (#531) --- src/subcommand/torrent/dump.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/subcommand/torrent/dump.rs b/src/subcommand/torrent/dump.rs index 8ca0327..b302866 100644 --- a/src/subcommand/torrent/dump.rs +++ b/src/subcommand/torrent/dump.rs @@ -55,7 +55,7 @@ impl<'a> Display for Fmt<'a> { for (i, (key, value)) in dict.iter().enumerate() { if i > 0 { - write!(f, " ,")?; + write!(f, ", ")?; } fmt_string(f, key)?; write!(f, ": ")?; @@ -170,6 +170,7 @@ mod tests { case("de", "{}\n"); case("d1:xi0ee", "{\"x\": 0}\n"); + case("d1:xi0e1:yi1ee", "{\"x\": 0, \"y\": 1}\n"); case("d3:xyzd3:abci0eee", "{\"xyz\": {\"abc\": 0}}\n"); } }