summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSam Scott <sam.scott89@gmail.com>2017-04-29 20:17:53 +0100
committerSam Scott <sam.scott89@gmail.com>2017-04-29 20:17:53 +0100
commita810aff7ab7891579d69fcdffefeaca3835ce533 (patch)
tree28f45e8be35c85d7fb33b955b629856cb93c17c4 /tests
parent0f8cab2e85925099e35d0a42bac71f86ef624dbf (diff)
Revert changes to tests to allow integer keys.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_deserialize.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_deserialize.rs b/tests/test_deserialize.rs
index 4d44e5e..569be0c 100644
--- a/tests/test_deserialize.rs
+++ b/tests/test_deserialize.rs
@@ -24,7 +24,7 @@ struct QueryParams {
macro_rules! map_test {
($string:expr, $($mapvars:tt)*) => {
let expected_map = hash_to_map!(New $($mapvars)*);
- let testmap: HashMap<String, _> = qs::from_str($string).unwrap();
+ let testmap: HashMap<_, _> = qs::from_str($string).unwrap();
assert_eq!(expected_map, testmap);
}
}
@@ -37,13 +37,13 @@ macro_rules! hash_to_map {
//{}
// This parses a single map entry, with a value explicitly an expression.
($map:expr, $k:tt[e $v:expr] $($rest:tt)*) => {{
- $map.insert($k.to_string(), $v.to_owned());
+ $map.insert($k.to_owned(), $v.to_owned());
hash_to_map!($map, $($rest)*);
}};
// This parses a single map entry, plus the rest of the values.
($map:expr, $k:tt[$v:tt] $($rest:tt)*) => {{
- $map.insert($k.to_string(), $v.to_owned());
+ $map.insert($k.to_owned(), $v.to_owned());
hash_to_map!($map, $($rest)*);
}};
@@ -52,7 +52,7 @@ macro_rules! hash_to_map {
($map:expr, $k:tt[$($inner:tt)*] $($rest:tt)*) => {{
let mut inner_map = HashMap::new();
hash_to_map!(inner_map, $($inner)*);
- $map.insert($k.to_string(), inner_map);
+ $map.insert($k.to_owned(), inner_map);
hash_to_map!($map, $($rest)*);
}};