Skip to content

Commit

Permalink
Add toml example
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Jan 23, 2017
1 parent 3bb2852 commit dce81f7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 883,24 @@ to parse, and serializes from Rust types with [`serde`](#serde).

[Cargo.toml]: http://doc.crates.io/manifest.html

**Example**: [`examples/toml.rs`]

[`examples/toml.rs`]: examples/toml.rs

```rust
extern crate toml;

fn main() {
let toml = r#"
[test]
foo = "bar"
"#;

let value = toml::Parser::new(toml).parse().unwrap();
println!("{:?}", value);
}
```

 
 
 



Expand Down
11 changes: 11 additions & 0 deletions examples/toml.rs
Original file line number Diff line number Diff line change
@@ -0,0 1,11 @@
extern crate toml;

fn main() {
let toml = r#"
[test]
foo = "bar"
"#;

let value = toml::Parser::new(toml).parse().unwrap();
println!("{:?}", value);
}

0 comments on commit dce81f7

Please sign in to comment.