You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/07 10:48:41 UTC
[jira] [Commented] (THRIFT-4099) Auto-derive Hash for generated
Rust structs
[ https://issues.apache.org/jira/browse/THRIFT-4099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15960598#comment-15960598 ]
ASF GitHub Bot commented on THRIFT-4099:
----------------------------------------
GitHub user allengeorge opened a pull request:
https://github.com/apache/thrift/pull/1246
THRIFT-4099: Derive Hash trait for Rust structs
Auto-derive `Hash` trait for all generated types. Verified that all checks listed [in the JIRA](https://issues.apache.org/jira/browse/THRIFT-4099) worked.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/allengeorge/thrift thrift-4099
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1246.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1246
----
commit b8279f5b23c3da771be70d20f48b3a14cdad83e8
Author: Allen George <al...@gmail.com>
Date: 2017-04-06T12:28:22Z
THRIFT-4099: Derive Hash trait for Rust structs
----
> Auto-derive Hash for generated Rust structs
> -------------------------------------------
>
> Key: THRIFT-4099
> URL: https://issues.apache.org/jira/browse/THRIFT-4099
> Project: Thrift
> Issue Type: Improvement
> Components: Rust - Compiler
> Reporter: Allen George
> Priority: Minor
>
> Currently Thrift structs are turned into Rust {{struct}} definitions that do not have an auto-derived {{Hash}}. We should auto-derive this trait.
> The following behaviors should be checked:
> # Can still derive {{Hash}} even if the struct contains a {{double}}
> # Can still derive {{Hash}} even if the struct contains {{set<double>}}
> # Can still derive {{Hash}} even if the struct contains {{map<double, double>}}
> Basically, doubles are represented in the auto-generated code by {{OrderedFloat}} instead of {{f64}} since we cannot derive a hash for, or order Rust floats. The resulting code should work even if doubles are contained any where in the structure.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)