summaryrefslogtreecommitdiff
path: root/rust/examples/dwarf/dwarf_import/src/functions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src/functions.rs')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/functions.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/functions.rs b/rust/examples/dwarf/dwarf_import/src/functions.rs
index 20858917..069f4ba3 100644
--- a/rust/examples/dwarf/dwarf_import/src/functions.rs
+++ b/rust/examples/dwarf/dwarf_import/src/functions.rs
@@ -41,8 +41,12 @@ fn get_parameters<R: Reader<Offset = usize>>(
constants::DW_TAG_formal_parameter => {
let name = get_name(dwarf, unit, child.entry());
let type_ = get_type(dwarf, unit, child.entry(), debug_info_builder);
- if let (Some(parameter_name), Some(parameter_type)) = (name, type_) {
- result.push(Some((parameter_name, parameter_type)));
+ if let Some(parameter_name) = name {
+ if let Some(parameter_type) = type_ {
+ result.push(Some((parameter_name, parameter_type)));
+ } else {
+ result.push(Some((parameter_name, 0)))
+ }
} else {
result.push(None)
}