1 macro_rules
! json_str
{
5 ([ $e0
:tt $
(, $e
:tt
)* $
(,)?
]) => {
8 $
(",", json_str
!($e
),)*
14 ({ $k0:tt : $v0:tt $(, $k:tt : $v:tt)* $(,)? }
) => {
16 stringify
!($k0
), ":", json_str
!($v0
),
17 $
(",", stringify
!($k
), ":", json_str
!($v
),)*
28 macro_rules
! pretty_str
{
30 pretty_str_impl
!("", $json
)
34 macro_rules
! pretty_str_impl
{
35 ($indent
:expr
, []) => {
38 ($indent
:expr
, [ $e0
:tt $
(, $e
:tt
)* $
(,)?
]) => {
40 $indent
, pretty_str_impl
!(concat
!(" ", $indent
), $e0
),
41 $
(",\n ", $indent
, pretty_str_impl
!(concat
!(" ", $indent
), $e
),)*
44 ($indent
:expr
, {}
) => {
47 ($indent
:expr
, { $k0:tt : $v0:tt $(, $k:tt : $v:tt)* $(,)? }
) => {
49 $indent
, stringify
!($k0
), ": ", pretty_str_impl
!(concat
!(" ", $indent
), $v0
),
50 $
(",\n ", $indent
, stringify
!($k
), ": ", pretty_str_impl
!(concat
!(" ", $indent
), $v
),)*
53 ($indent
:expr
, ($other
:tt
)) => {
56 ($indent
:expr
, $other
:tt
) => {