Skip to content

Commit

Permalink
fix(mbuild): doit() call with enum type annotation
Browse files Browse the repository at this point in the history
It's syntax I never used before, but ... works !
Now lets try to get the BorrowMut back
  • Loading branch information
Byron committed Mar 8, 2015
1 parent 5b2d8a7 commit 6fad760
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mako/lib/mbuild.mako
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ ${'.' + api.terms.action | indent_by(13)}();
stripped = lambda s: s.strip().strip(',')
qualifier = ''
for p in media_params:
type_params += p.type.param + (' = %s, ' % p.type.default)
where += p.type.param + ': BorrowMut<' + p.type.where + '>, '
type_params += p.type.param + ', '
where += p.type.param + ': ' + p.type.where + ', '
add_args += p.type.arg_name + ': ' + ('Option<%s>' % p.type.param) + ', '
# end for each param
where = ' where ' + stripped(where)
Expand All @@ -292,14 +292,14 @@ ${'.' + api.terms.action | indent_by(13)}();
% for p in media_params:
pub fn ${api.terms.upload_action}${p.type.suffix}<${p.type.param}>(mut self, ${p.type.arg_name}: ${p.type.param}) -> ${rtype}
where ${p.type.param}: BorrowMut<${p.type.where}> {
where ${p.type.param}: ${p.type.where} {
self.${api.terms.action}(\
% for _ in range(0, loop.index):
None, \
None::<${p.type.default}>, \
% endfor
Some(${p.type.arg_name}), \
% for _ in range(loop.index+1, len(media_params)):
None, \
None::<${p.type.default}>, \
% endfor
)
}
Expand Down

0 comments on commit 6fad760

Please sign in to comment.