summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2018-04-07 07:21:49 -0400
committerTamir Duberstein <tamird@gmail.com>2018-04-08 18:32:49 -0400
commite28cb8a13ecacf0dc4aeab6119ca9fea8d0a1cc9 (patch)
tree3f04a42d273a40e233284ba755a25b9aa75a5d80 /src/codegen/mod.rs
parent85b1a3a9f19b57c228b4cda5915d2219e15e8533 (diff)
TemplateParameters.all_template_params doesn't return Option
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 34e87d89..e2a8b33f 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -479,11 +479,8 @@ impl CodeGenerator for Var {
// We can't generate bindings to static variables of templates. The
// number of actual variables for a single declaration are open ended
// and we don't know what instantiations do or don't exist.
- let type_params = item.all_template_params(ctx);
- if let Some(params) = type_params {
- if !params.is_empty() {
- return;
- }
+ if !item.all_template_params(ctx).is_empty() {
+ return;
}
let ty = self.ty().to_rust_ty_or_opaque(ctx, &());
@@ -3240,11 +3237,8 @@ impl CodeGenerator for Function {
// generate bindings to template functions, because the set of
// instantiations is open ended and we have no way of knowing which
// monomorphizations actually exist.
- let type_params = item.all_template_params(ctx);
- if let Some(params) = type_params {
- if !params.is_empty() {
- return;
- }
+ if !item.all_template_params(ctx).is_empty() {
+ return;
}
let name = self.name();