Skip to content

Commit

Permalink
fix(types): prevent type-clash with Result
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
Byron committed Mar 20, 2015
1 parent 265b448 commit b6ebb1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mako/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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<String, %s>" % (rust_type, nested_type(t))
Expand Down

0 comments on commit b6ebb1e

Please sign in to comment.