chyh1990 / yaml-rust

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

Expose info() api #190

Open olalonde opened 2 years ago

olalonde commented 2 years ago

Add a function that exposes the info value. This is needed since description() is deprecated.

hoodie commented 2 years ago

If I understand this correctly this always gives you the same message as ScanError::to_string(). Is it really necessary to have it then?

olalonde commented 2 years ago

Not exactly the same:

"mapping values are not allowed in this context at line 4 column 4" (to_string()) "mapping values are not allowed in this context" (info())

Personally, it would help me because I use yaml-rust to parse a section of a larger file so the column/line info is wrong from the perspective of the end user. Right now, I trim the message I receive from to_string but that's not very elegant.

olalonde commented 2 years ago

@hoodie are you a maintainer of yaml-rust? I was under the impression it was unmaintained.

hoodie commented 2 years ago

I am not, just reading along, because I contributed a little in the past. I don't think it's unmaintained, but the maintainer seldomly checks the PRs.

olalonde commented 2 years ago

Ok well, the last commit was a year ago... That's pretty seldom indeed.

davvid commented 7 months ago

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