From 19b5ed348746bd55cc54f6defdaada65cd8e5bf9 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 11 Mar 2023 11:06:08 -0500 Subject: [PATCH] Appease clippy --- common/src/states/utils.rs | 15 +++++---------- world/src/layer/tree.rs | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 50996c256c..3ff9b0340b 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -923,16 +923,11 @@ pub fn handle_manipulate_loadout( // Some(None): No required items // Some(Some(_)): Required items satisfied, contains info about them let has_required_items = match required_item { - Some((item_id, consume)) => { - if let Some(slot) = data - .inventory - .and_then(|inv| inv.get_slot_of_item_by_def_id(&item_id)) - { - Some(Some((item_id, slot, consume))) - } else { - None - } - }, + // Produces `None` if we can't find the item or `Some(Some(_))` if we can + Some((item_id, consume)) => data + .inventory + .and_then(|inv| inv.get_slot_of_item_by_def_id(&item_id)) + .map(|slot| Some((item_id, slot, consume))), None => Some(None), }; diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 1fbe4ea8b4..836be68044 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -287,7 +287,7 @@ pub fn apply_trees_to( }, (_, _, _, true) => &StructureBlock::None, (true, _, _, _) => &t.config.trunk_block, - (_, true, _, _) => &leaf_block, + (_, true, _, _) => leaf_block, _ => &StructureBlock::None, }, ),