Appease clippy

This commit is contained in:
Imbris 2023-03-11 11:06:08 -05:00
parent 619f62cb63
commit 19b5ed3487
2 changed files with 6 additions and 11 deletions

View File

@ -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),
};

View File

@ -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,
},
),