summaryrefslogtreecommitdiff
path: root/rust/examples/dwarf/dwarf_import/src/lib.rs
diff options
context:
space:
mode:
authorMichael Krasnitski <michael.krasnitski@gmail.com>2024-04-16 19:32:04 -0400
committerKyle Martin <krm504@nyu.edu>2024-05-09 13:11:41 -0400
commit29b62677dad48aa4d55ad2dae5d176d9880216bd (patch)
treef205a5f4ebb7e71ea132fe06a7076c70616d3c62 /rust/examples/dwarf/dwarf_import/src/lib.rs
parent608f261e6bca5869e748d4509da92a5717dce75d (diff)
Fix clippy warnings and run rustfmt
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src/lib.rs')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/lib.rs45
1 files changed, 22 insertions, 23 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs
index 06809428..8aeac658 100644
--- a/rust/examples/dwarf/dwarf_import/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_import/src/lib.rs
@@ -106,8 +106,7 @@ fn recover_names<R: Reader<Offset = usize>>(
}
}
} else {
- namespace_qualifiers
- .push((depth, "anonymous_namespace".to_string()));
+ namespace_qualifiers.push((depth, "anonymous_namespace".to_string()));
}
}
@@ -129,22 +128,24 @@ fn recover_names<R: Reader<Offset = usize>>(
depth,
match entry.tag() {
constants::DW_TAG_class_type => "anonymous_class".to_string(),
- constants::DW_TAG_structure_type => "anonymous_structure".to_string(),
+ constants::DW_TAG_structure_type => {
+ "anonymous_structure".to_string()
+ }
constants::DW_TAG_union_type => "anonymous_union".to_string(),
_ => unreachable!(),
- }
+ },
))
}
debug_info_builder_context.set_name(
get_uid(&unit, entry),
- simplify_str_to_str(
- namespace_qualifiers
- .iter()
- .map(|(_, namespace)| namespace.to_owned())
- .collect::<Vec<String>>()
- .join("::"),
- )
- .to_string(),
+ simplify_str_to_str(
+ namespace_qualifiers
+ .iter()
+ .map(|(_, namespace)| namespace.to_owned())
+ .collect::<Vec<String>>()
+ .join("::"),
+ )
+ .to_string(),
);
}
constants::DW_TAG_typedef
@@ -153,17 +154,15 @@ fn recover_names<R: Reader<Offset = usize>>(
if let Some(name) = get_name(&unit, entry, debug_info_builder_context) {
debug_info_builder_context.set_name(
get_uid(&unit, entry),
- simplify_str_to_str(
- namespace_qualifiers
- .iter()
- .chain(vec![&(-1, name)].into_iter())
- .map(|(_, namespace)| {
- namespace.to_owned()
- })
- .collect::<Vec<String>>()
- .join("::"),
- )
- .to_string(),
+ simplify_str_to_str(
+ namespace_qualifiers
+ .iter()
+ .chain(vec![&(-1, name)].into_iter())
+ .map(|(_, namespace)| namespace.to_owned())
+ .collect::<Vec<String>>()
+ .join("::"),
+ )
+ .to_string(),
);
}
}