mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Don't use RootedReference for Option<T> in codegen anymore
This commit is contained in:
parent
5fe5e5d6de
commit
1744a42dad
2 changed files with 4 additions and 16 deletions
|
@ -7250,9 +7250,11 @@ def camel_to_upper_snake(s):
|
|||
|
||||
def process_arg(expr, arg):
|
||||
if arg.type.isGeckoInterface() and not arg.type.unroll().inner.isCallback():
|
||||
if arg.variadic or arg.type.isSequence() or arg.type.nullable() and arg.optional:
|
||||
if arg.variadic or arg.type.isSequence():
|
||||
expr += ".r()"
|
||||
elif arg.type.nullable() or arg.optional:
|
||||
elif arg.type.nullable() and arg.optional and not arg.defaultValue:
|
||||
expr += ".as_ref().map(Option::deref)"
|
||||
elif arg.type.nullable() or arg.optional and not arg.defaultValue:
|
||||
expr += ".deref()"
|
||||
else:
|
||||
expr = "&" + expr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue