From a2d16944cd5a32b6b0a10ea0a30d5cd48d40f740 Mon Sep 17 00:00:00 2001 From: philippeitis <33013301+philippeitis@users.noreply.github.com> Date: Sat, 8 Oct 2022 12:36:59 -0700 Subject: [PATCH] Make format fully supported --- src/generator/lib/util.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/generator/lib/util.py b/src/generator/lib/util.py index 35fb586068..df82a1a111 100644 --- a/src/generator/lib/util.py +++ b/src/generator/lib/util.py @@ -455,13 +455,9 @@ def to_rust_type( tn = 'Option>' % tn return wrap_type(tn) try: - # TODO: add support for all types and remove this check - # rust_type = TYPE_MAP[t.get("format", t["type"])] - # prefer format if present - provides support for i64 - if "format" in t and t["format"] in TYPE_MAP: - rust_type = TYPE_MAP[t["format"]] - else: - rust_type = TYPE_MAP[t["type"]] + # prefer format if present + rust_type = TYPE_MAP[t.get("format", t["type"])] + if t['type'] == 'array': return wrap_type("%s<%s>" % (rust_type, nested_type(t))) elif t['type'] == 'object':