<commit_before># json_str

[![Build Status](https://travis-ci.org/KodrAus/json_str.svg?branch=master)](https://travis-ci.org/KodrAus/json_str) 
[![Latest Version](https://img.shields.io/crates/v/json_str.svg)](https://crates.io/crates/json_str)

[Docs and samples](http://kodraus.github.io/rustdoc/json_str/)

Provides an easy way to build json strings in Rust without having to use ungainly strings on `stable` and `nightly` channels.
Rust has a json-like syntax for defining structures, so it's easy to convert a valid Rust token tree into json.
This crate will also minify whitespace and standardise quotes while it's building the `String`.

On `stable`, conversion is provided by a simple macro.
On `nightly`, conversion is provided by a compiler plugin that does that sanitises the input at compile time instead of runtime.
The `nightly` channel also provides an alternative plugin for creating `&str` literals instead of `String`s, to avoid that allocation.<commit_msg>expand readme a bit<commit_after># json_str

[![Build Status](https://travis-ci.org/KodrAus/json_str.svg?branch=master)](https://travis-ci.org/KodrAus/json_str) 
[![Latest Version](https://img.shields.io/crates/v/json_str.svg)](https://crates.io/crates/json_str)

[Docs and samples](http://kodraus.github.io/rustdoc/json_str/)

Provides an easy way to build json strings in Rust without having to use ungainly strings on `stable` and `nightly` channels. Rust has a json-like syntax for defining structures, so it's easy to convert some valid Rust token trees into json. This crate will also minify whitespace and standardise quotes while it's building the `String`. It's an otherwise very simple sanitiser that doesn't do any escaping within values or support interpolation.

On `stable`, conversion is provided by a simple macro. On `nightly`, conversion is provided by a compiler plugin that sanitises the input at compile time instead of runtime. The `nightly` channel also provides an alternative plugin for creating `&str` literals instead of `String`s, to avoid that allocation.
{'fraction_non_alphanumeric': 0.0947061680427392, 'fraction_numerical': 0.0, 'mean_word_length': 5.186186186186186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '153039', 'n_tokens_mistral': 607, 'n_tokens_neox': 589, 'n_words': 242}