Use untagged_option crate

This commit is contained in:
Jonas Schievink 2017-09-06 19:06:43 +02:00
parent c8bdb7329f
commit 57ed0963ff
3 changed files with 8 additions and 7 deletions

View file

@ -233,7 +233,7 @@ fn init(app: &App, main: &mut Vec<Tokens>, root: &mut Vec<Tokens>) {
});
late_resources.push(quote! {
#_name = #krate::LateResource { init: _late_resources.#name };
#_name = #krate::UntaggedOption { some: _late_resources.#name };
});
}
@ -344,7 +344,7 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
},
None => quote! {
// Resource initialized in `init`
static mut #_name: #krate::LateResource<#ty> = #krate::LateResource { uninit: () };
static mut #_name: #krate::UntaggedOption<#ty> = #krate::UntaggedOption { none: () };
},
});
}
@ -587,7 +587,7 @@ fn tasks(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
}
} else {
quote! {
#name: ::#krate::Static::ref_mut(&mut ::#_name.init),
#name: ::#krate::Static::ref_mut(::#_name.as_mut()),
}
});
} else {