From b6ebb1ec371c833ef7386264ed9522b880586316 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 20 Mar 2015 08:46:30 +0100 Subject: [PATCH] fix(types): prevent type-clash with `Result` This should have been fixed in previous commit, but wasn't. Actually a change that fixed one API, broke the other, and vice-versa. It's kind of a hack, because it's tailored to fix particular cases only, yet I believe it's contained enough to say 'good enough'. --- src/mako/lib/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mako/lib/util.py b/src/mako/lib/util.py index 24010994cab..ef2c9b288f3 100644 --- a/src/mako/lib/util.py +++ b/src/mako/lib/util.py @@ -305,8 +305,8 @@ def nested_type(nt): def wrap_type(tn): if allow_optionals: - tn = "Option<%s>" % tn - return unique_type_name(tn) + tn = "Option<%s>" % unique_type_name(tn) + return tn # unconditionally handle $ref types, which should point to another schema. if TREF in t: @@ -320,7 +320,7 @@ def wrap_type(tn): try: rust_type = TYPE_MAP[t.type] if t.type == 'array': - return "%s<%s>" % (rust_type, nested_type(t)) + return "%s<%s>" % (rust_type, unique_type_name((nested_type(t)))) elif t.type == 'object': if _is_map_prop(t): return "%s" % (rust_type, nested_type(t))