Skip to content

Add from_value convenience function - #618

Open
ChrisJr404 wants to merge 1 commit into
ron-rs:masterfrom
ChrisJr404:add-from-value-convenience
Open

ChrisJr404 wants to merge 1 commit into
ron-rs:masterfrom
ChrisJr404:add-from-value-convenience

Conversation

@ChrisJr404

Copy link
Copy Markdown

As suggested in #255, this adds from_value to the de module so a Value can be deserialized into a T with the same convenience as from_str / from_bytes / from_reader.

It just wraps the existing Value::into_rust, so there's no new logic. It returns a plain Error instead of a SpannedError, since an in-memory Value has no source text to point a span into.

to_value and the wider Value conversion work mentioned in #255 are left out on purpose, since those were flagged for the 0.9 round.

  • I've included my change in CHANGELOG.md

Comment thread CHANGELOG.md

- Add support for parsing Rust-style string continuation escapes ([#585](https://github.com/ron-rs/ron/issues/585))

### Additions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Additions
### API Changes

Comment thread CHANGELOG.md

### Additions

- Add the `from_value` convenience function to deserialize a `T` from a `Value` ([#255](https://github.com/ron-rs/ron/issues/255))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please link to this PR instead, and also drive-by fix the above change log entry to also link to its PR?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants