mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Rust upgrade to 2016-04-12
This commit is contained in:
parent
7faa3ed9cb
commit
e10c580768
13 changed files with 163 additions and 152 deletions
|
@ -15,10 +15,10 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
|
|||
let struct_name = item.ident;
|
||||
// This path has to be hardcoded, unfortunately, since we can't resolve paths at expansion time
|
||||
match def.fields().iter().find(
|
||||
|f| match_ty_unwrap(&*f.node.ty, &["dom", "bindings", "reflector", "Reflector"]).is_some()) {
|
||||
|f| match_ty_unwrap(&*f.ty, &["dom", "bindings", "reflector", "Reflector"]).is_some()) {
|
||||
// If it has a field that is a Reflector, use that
|
||||
Some(f) => {
|
||||
let field_name = f.node.ident();
|
||||
let field_name = f.ident;
|
||||
let impl_item = quote_item!(cx,
|
||||
impl ::dom::bindings::reflector::Reflectable for $struct_name {
|
||||
fn reflector<'a>(&'a self) -> &'a ::dom::bindings::reflector::Reflector {
|
||||
|
@ -33,7 +33,7 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
|
|||
},
|
||||
// Or just call it on the first field (supertype).
|
||||
None => {
|
||||
let field_name = def.fields()[0].node.ident();
|
||||
let field_name = def.fields()[0].ident;
|
||||
let impl_item = quote_item!(cx,
|
||||
impl ::dom::bindings::reflector::Reflectable for $struct_name {
|
||||
fn reflector<'a>(&'a self) -> &'a ::dom::bindings::reflector::Reflector {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue