summaryrefslogtreecommitdiff
path: root/src/ser.rs
diff options
context:
space:
mode:
authorSam Scott <sam@osohq.com>2021-06-09 15:32:07 -0400
committerGitHub <noreply@github.com>2021-06-09 15:32:07 -0400
commite369232e36d6fda5df3d2e533b2cdc5c5d2a23bb (patch)
treec04efbee5807cca63c99d96dbba8645f5b96bc99 /src/ser.rs
parent5bfaa7aa9f38806436e15928917cbd841a61e0f2 (diff)
Support deserializing sequences to a hashmap with keys. (#51)
Diffstat (limited to 'src/ser.rs')
-rw-r--r--src/ser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ser.rs b/src/ser.rs
index 654c889..c281614 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -126,9 +126,9 @@ impl<'a, W: 'a + Write> QsSerializer<'a, W> {
.map(replace_space)
.collect::<String>();
let key = if let Some(ref key) = self.key {
- format!("{}[{}]", key, newkey).into()
+ format!("{}[{}]", key, newkey)
} else {
- newkey.to_owned()
+ newkey
};
self.key = Some(Cow::Owned(key))
}