Make the Rust codegen compile. (#6411)

* Use the right package name for the Rust crate.

* Change getters on models to return Option for non-required fields.

* Cleanup Rust generation and get example compiling again.

* Use underscore names for functions.
This commit is contained in:
Ahmed Charles
2017-09-01 09:06:55 -07:00
committed by wing328
parent adf5d643d5
commit 60766c6210
22 changed files with 346 additions and 399 deletions

View File

@@ -325,11 +325,11 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
// method name cannot use reserved keyword, e.g. return
if (isReservedWord(sanitizedOperationId)) {
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize("call_" + operationId));
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore("call_" + operationId));
sanitizedOperationId = "call_" + sanitizedOperationId;
}
return camelize(sanitizedOperationId);
return underscore(sanitizedOperationId);
}
@Override