Ben Chuanlong Du's Blog

It is never too late to learn.

Parse TOML Files in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

In [ ]:
https://crates.io/crates/toml
In [2]:
:sccache 1
:dep toml = "0.5.9"
Out[2]:
sccache: true
In [3]:
use toml::Value;
In [6]:
let table = "foo = 'bar'".parse::<Value>().unwrap();
table
Out[6]:
Table({"foo": String("bar")})
In [7]:
table["foo"]
Out[7]:
String("bar")
In [ ]:

Comments