Commit graph

12 commits

Author SHA1 Message Date
Ethiraric
d2caaf2ab3 Prepare the ground for annotated parsing.
* Make `YamlLoader` generic on the type of the `Node`. This is required
   because deeper node need to have annotations too.
 * Add a `LoadableYamlNode` trait, required for YAML node types to be
   loaded by `YamlLoader`. It contains methods required by `YamlLoader`
   during loading.
 * Implement `LoadableYamlNode` for `Yaml`.
 * Take `load_from_str` out of `YamlLoader` for parsing non-annotated
   nodes. This avoids every user to specify the generics in
   `YamlLoader::<Yaml>::load_from_str`.
2024-07-03 00:55:41 +02:00
Ethiraric
f166970a3e Use cargo features. 2024-03-30 19:24:54 +01:00
Alistair Francis
0f1dedc584 yaml: Implement IndexMut
This implements the IndexMut trait for Yaml. This allows indexing the
Yaml type while having a mutable reference.

Unlike the Index, this will panic on a failure. That is allowed as per
the Rust documentation [1]. We don't have the option of returning a
mutable reference to BAD_VALUE as that is unsafe. So instead we just
panic.

1: https://doc.rust-lang.org/std/ops/trait.IndexMut.html#tymethod.index_mut

Resolves: https://github.com/chyh1990/yaml-rust/issues/123
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Co-authored-by: Ethiraric <ethiraric@gmail.com>
2024-03-30 18:52:39 +01:00
David Aguilar
b5c9eec454 yaml-rust2 v0.8.0 2024-03-25 22:18:38 -07:00
David Aguilar
ae65040d3b CHANGELOG: mention the linguist development-related updates 2024-03-25 22:18:37 -07:00
David Aguilar
ddb6885a17 yaml: add YamlLoader::load_from_parser(&Parser)
Make it easier to load documents from a prebuilt Parser.
2024-03-25 00:06:10 +01:00
David Aguilar
e9e428eeaf CHANGELOG: simplify the formatting and document YamlLoader::documents() 2024-03-24 14:45:52 -07:00
David Aguilar
2c7ecbf054 CHANGELOG: document the keep_tags API addition 2024-03-24 14:27:04 -07:00
Ethiraric
eddea11e01 Switch from encoding to encoding_rs.
See https://github.com/rustsec/advisory-db/issues/1605.
2024-03-24 17:14:44 +01:00
David Aguilar
e00d7f251e CHANGELOG: move recent updates to v0.7.0 and add a v0.6.0 section 2024-03-20 14:21:27 +01:00
David Aguilar
4c64feb5ad Eliminate panics and enable the missing panics docs check 2024-03-19 15:26:16 +01:00
David Aguilar
432041aafb Add a CHANGELOG to keep track of yaml-rust2 development 2024-03-19 15:26:16 +01:00