From 7549db4ffc27feb15b55f009d02299135ac1b3c7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 2 Dec 2015 11:54:10 +0100 Subject: [PATCH] Fix JsonHeaderParser::visit_json() --- src/storage/json/parser.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/storage/json/parser.rs b/src/storage/json/parser.rs index c813e9c5..815e77be 100644 --- a/src/storage/json/parser.rs +++ b/src/storage/json/parser.rs @@ -74,11 +74,12 @@ fn visit_json(v: &Value) -> FileHeaderData { } }, &Value::Object(ref btree) => { + let btree = btree.clone(); FileHeaderData::Map{ - keys: btree.clone().iter().map(|(k, v)| + keys: btree.into_iter().map(|(k, v)| FileHeaderData::Key { - name: k.clone(), - value: Box::new(visit_json(v)), + name: k, + value: Box::new(visit_json(&v)), } ).collect() }