chyh1990 / yaml-rust

A pure rust YAML implementation.
Apache License 2.0
601 stars 138 forks source link

introduce `or` function #179

Open oldaccountdeadname opened 2 years ago

oldaccountdeadname commented 2 years ago

Similarly to or for Rust's options, this patch provides a way to 'override' the value of a Yaml node if it's some form of error.

It's a pretty small patch: if this type of albeit trivial manipulation is beyond the scope of the library, feel free not to merge! Thanks!

oldaccountdeadname commented 2 years ago

looks like checks are failing --- tests pass on my machine, so I'm not entirely sure what's going on there. Looking at the logs, it looks like the windows-gnu builds are failing due to a missing mingw build, though I'm not familiar with this CI system and don't really know how to fix that.

davvid commented 7 months ago

FWIW I've merged this into my fork: https://github.com/davvid/yaml-rust/