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

Auto-derive Hash for generated Rust structs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.11.0
    • Rust - Compiler
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: