summaryrefslogtreecommitdiff
path: root/plugins/bntl_utils/src/winmd/translate.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-02-17 20:30:44 -0800
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-02-23 00:09:44 -0800
commit65c217ae27e6b0abe26d5baea40f2bab695a3651 (patch)
tree162800e27c5dbe95eb187522b69dec936b4118bf /plugins/bntl_utils/src/winmd/translate.rs
parent37008b7fa16837d04c1658868646cad681cbe035 (diff)
[BNTL Utils] Fix misc clippy lints
Diffstat (limited to 'plugins/bntl_utils/src/winmd/translate.rs')
-rw-r--r--plugins/bntl_utils/src/winmd/translate.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/bntl_utils/src/winmd/translate.rs b/plugins/bntl_utils/src/winmd/translate.rs
index 01ea54a5..17750354 100644
--- a/plugins/bntl_utils/src/winmd/translate.rs
+++ b/plugins/bntl_utils/src/winmd/translate.rs
@@ -283,7 +283,7 @@ impl WindowsMetadataTranslator {
let nested: Result<HashMap<String, _>, _> = structure
.index()
- .nested(structure.clone())
+ .nested(*structure)
.map(|n| {
// TODO: Are all nested fields a struct?
let nested_ty = self.translate_struct(&n)?;
@@ -372,11 +372,7 @@ impl WindowsMetadataTranslator {
let mut constants = Vec::new();
for field in class.fields() {
- if let Some(constant) = field
- .constant()
- .map(|c| self.value_to_u64(&c.value()))
- .flatten()
- {
+ if let Some(constant) = field.constant().and_then(|c| self.value_to_u64(&c.value())) {
constants.push(MetadataConstantInfo {
name: field.name().to_string(),
namespace: namespace.clone(),
@@ -525,8 +521,7 @@ impl WindowsMetadataTranslator {
}
let variant_constant = variant
.constant()
- .map(|c| self.value_to_u64(&c.value()))
- .flatten()
+ .and_then(|c| self.value_to_u64(&c.value()))
.unwrap_or(last_constant);
let variant_name = variant.name().to_string();
variants.push((variant_name, variant_constant));