mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Switch most crates to the 2018 edition
This commit is contained in:
parent
76e59a46d3
commit
9f9bf8f6bc
57 changed files with 82 additions and 28 deletions
|
@ -5686,7 +5686,11 @@ class CGInterfaceTrait(CGThing):
|
|||
yield name, arguments, rettype
|
||||
|
||||
def fmt(arguments):
|
||||
return "".join(", %s: %s" % argument for argument in arguments)
|
||||
keywords = {"async"}
|
||||
return "".join(
|
||||
", %s: %s" % (name if name not in keywords else "r#" + name, type_)
|
||||
for name, type_ in arguments
|
||||
)
|
||||
|
||||
def contains_unsafe_arg(arguments):
|
||||
if not arguments or len(arguments) == 0:
|
||||
|
@ -6250,7 +6254,7 @@ class CGDictionary(CGThing):
|
|||
d = self.dictionary
|
||||
if d.parent:
|
||||
initParent = ("{\n"
|
||||
" match try!(%s::%s::new(cx, val)) {\n"
|
||||
" match r#try!(%s::%s::new(cx, val)) {\n"
|
||||
" ConversionResult::Success(v) => v,\n"
|
||||
" ConversionResult::Failure(error) => {\n"
|
||||
" throw_type_error(cx, &error);\n"
|
||||
|
@ -6396,7 +6400,7 @@ class CGDictionary(CGThing):
|
|||
conversion = (
|
||||
"{\n"
|
||||
" rooted!(in(cx) let mut rval = UndefinedValue());\n"
|
||||
" match try!(get_dictionary_property(cx, object.handle(), \"%s\", rval.handle_mut())) {\n"
|
||||
" match r#try!(get_dictionary_property(cx, object.handle(), \"%s\", rval.handle_mut())) {\n"
|
||||
" true => {\n"
|
||||
"%s\n"
|
||||
" },\n"
|
||||
|
@ -7167,7 +7171,7 @@ class CallbackOperationBase(CallbackMethod):
|
|||
"methodName": self.methodName
|
||||
}
|
||||
getCallableFromProp = string.Template(
|
||||
'try!(self.parent.get_callable_property(cx, "${methodName}"))'
|
||||
'r#try!(self.parent.get_callable_property(cx, "${methodName}"))'
|
||||
).substitute(replacements)
|
||||
if not self.singleOperation:
|
||||
return 'rooted!(in(cx) let callable =\n' + getCallableFromProp + ');\n'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue