Skip to content

Commit

Permalink
0.11.10
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejhirsz committed Oct 7, 2017
1 parent 0768e61 commit 98dcb57
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "json"
version = "0.11.9"
version = "0.11.10"
authors = ["Maciej Hirsz <[email protected]>"]
description = "JSON implementation in Rust"
repository = "https://github.com/maciejhirsz/json-rust"
Expand Down
1 change: 1 addition & 0 deletions src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub trait Generator {
}
}

#[inline(always)]
fn write_object(&mut self, object: &Object) -> io::Result<()> {
try!(self.write_char(b'{'));
let mut iter = object.iter();
Expand Down
16 changes: 5 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,11 @@ macro_rules! object {
// Non-empty object, no trailing comma.
//
// In this implementation, key/value pairs separated by commas.
{ $( $key:expr => $value:expr ),* } => ({
use $crate::object::Object;

let mut object = Object::new();

$(
object.insert($key, $value.into());
)*

$crate::JsonValue::Object(object)
});
{ $( $key:expr => $value:expr ),* } => {
object!( $(
$key => $value,
)* )
};

// Non-empty object, trailing comma.
//
Expand Down

0 comments on commit 98dcb57

Please sign in to comment.