edn-rs

[Experimental] Crate to parse and emit EDN * This lib does not make effort to conform the EDN received to EDN Spec. The lib that generated this EDN should be responsible for this.

Usage

Cargo.toml toml [dependencies] edn-rs = "0.4.3"

Parse an EDN into a EdnNode: ```rust

[macro_use]

extern crate edn_rs;

fn main() { let edn = edn!((sym 1.2 3 false :f nil 3/4)); let expected = Edn::List( List::new( vec![ Edn::Symbol("sym".tostring()), Edn::Double(1.2), Edn::Int(3), Edn::Bool(false), Edn::Key("f".tostring()), Edn::Nil, Edn::Rational("3/4".to_string()) ] ) );

    assert_eq!(edn, expected);

} ```

Emits EDN format from a Json file ```rust use ednrs::emitedn;

fn main() { let json = String::from("{\"hello\": \"world\"}"); let edn = String::from("{:hello \"world\"}");

 assert_eq!(edn, emit_edn(json));

} ```

Current Features