Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4099

Auto-derive Hash for generated Rust structs

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Rust - Compiler
    • Labels:
      None

      Description

      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:

      1. Can still derive Hash even if the struct contains a double
      2. Can still derive Hash even if the struct contains set<double>
      3. 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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jking3 James E. King III
                Reporter:
                allengeorge Allen George
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: