Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TryFrom<Value<T>> for i32/u32/i64/u64/f32/f64 #1908

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

webmaster128
Copy link
Contributor

Description

After the migration from 0.17 to 1.0 users have to handle much more dynamic return values. This PR makes working with Value<T> more convenient by implementing TryFrom<Value<T>> for i32/u32/i64/u64/f32/f64.

This PR is tested and demonstrated at CosmWasm/cosmwasm#658

Review

  • Add a short description of the the change to the CHANGELOG.md file

@webmaster128 webmaster128 force-pushed the implement-try-from-value branch from 05f4882 to 878da59 Compare December 9, 2020 17:08
Copy link
Contributor

@MarkMcCaskey MarkMcCaskey left a comment

Choose a reason for hiding this comment

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

Looks good to me!

One thing to note because I see some formatting changes, Wasmer is 1 behind the latest stable so you may need to reformat with Rust 1.47.0

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Dec 10, 2020
1908: Implement TryFrom<Value<T>> for i32/u32/i64/u64/f32/f64 r=syrusakbary a=webmaster128

# Description

After the migration from 0.17 to 1.0 users have to handle much more dynamic return values. This PR makes working with `Value<T>` more convenient by implementing `TryFrom<Value<T>>` for `i32`/`u32`/`i64`/`u64`/`f32`/`f64`.

This PR is tested and demonstrated at CosmWasm/cosmwasm#658

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Simon Warta <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

Build failed:

@syrusakbary
Copy link
Member

It seems it failed for external reasons to this PR.
Trying again

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 10, 2020

@bors bors bot merged commit df3a211 into wasmerio:master Dec 10, 2020
@webmaster128 webmaster128 deleted the implement-try-from-value branch December 10, 2020 07:52
@webmaster128
Copy link
Contributor Author

I see some formatting changes

The imports in lib/wasmer-types/src/lib.rs? This was caused by adding convert to the list. Then some of then ended up in the next line.

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.

3 participants