docs: fix example
This commit is contained in:
parent
368b865f2e
commit
f6900ce9fe
1 changed files with 2 additions and 2 deletions
|
@ -9,9 +9,9 @@ high-level crate, providing quick-and-easy YAML importing, exporting and object
|
||||||
manipulation.
|
manipulation.
|
||||||
|
|
||||||
```rs
|
```rs
|
||||||
use saphyr::{YamlLoader, YamlEmitter};
|
use saphyr::{Yaml, YamlEmitter};
|
||||||
|
|
||||||
let docs = YamlLoader::load_from_str("[1, 2, 3]").unwrap();
|
let docs = Yaml::load_from_str("[1, 2, 3]").unwrap();
|
||||||
let doc = &docs[0]; // select the first YAML document
|
let doc = &docs[0]; // select the first YAML document
|
||||||
assert_eq!(doc[0].as_i64().unwrap(), 1); // access elements by index
|
assert_eq!(doc[0].as_i64().unwrap(), 1); // access elements by index
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue