json_macro

Crates.iojson_macro
lib.rsjson_macro
version0.1.1
sourcesrc
created_at2015-12-07 08:58:48.058157
updated_at2015-12-15 00:03:39.936387
descriptionPure json macro for rust_serialize. No need compiler features.
homepagehttps://github.com/DenisKolodin/json_macro
repositoryhttps://github.com/DenisKolodin/json_macro
max_upload_size
id3587
size3,008
Denis Kolodin (therustmonk)

documentation

README

json_macro

Macro for rust_serialize crate realized with standard macro_rule (no needs compiler features).

Dependencies

Add this to your Cargo.toml:

[dependencies]
json_macro = "*"

and this to your crate root:

#[macro_use]
extern crate json_macro;

Usage

Use macro this way:

let s = json!("string");
let f = json!(3.1f64);
let a = json!([1,2,3,4,5]);
let o = json!({
	"one" => 1,
	"sub" => (json!({
		"two" => 2
	}))
});
Commit count: 3

cargo fmt