forked from BigfootDev/flatbuffers
* idl_gen_rust.cpp: Fix google/flatbuffers#5849 (Option/required-aware codegen for unions) The generated code was assuming that an Option is always returned by the union-getter method: however, this is only true if the field is not marked as `(required)`. * idl_gen_rust.cpp: flip conditional * idl_gen_rust.cpp: Add comment, as requested in review The code added is not covered by the integration test