mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
clippy
This commit is contained in:
parent
86445af09c
commit
abacdfc719
@ -993,9 +993,10 @@ impl Client {
|
||||
recipe: &str,
|
||||
craft_sprite: Option<(Vec3<i32>, SpriteKind)>,
|
||||
) -> bool {
|
||||
if self.can_craft_recipe(recipe).map_or(false, |cs| {
|
||||
let can_craft = self.can_craft_recipe(recipe).map_or(false, |cs| {
|
||||
cs.map_or(true, |cs| Some(cs) == craft_sprite.map(|(_, s)| s))
|
||||
}) {
|
||||
});
|
||||
if can_craft {
|
||||
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::InventoryEvent(
|
||||
InventoryEvent::CraftRecipe {
|
||||
recipe: recipe.to_string(),
|
||||
|
@ -438,23 +438,22 @@ impl<'a> Widget for Crafting<'a> {
|
||||
.unwrap_or(false)
|
||||
})
|
||||
});
|
||||
let state =
|
||||
if self
|
||||
.client
|
||||
let show_craft_sprite =
|
||||
self.client
|
||||
.available_recipes()
|
||||
.get(name.as_str())
|
||||
.map_or(false, |cs| {
|
||||
cs.map_or(true, |cs| {
|
||||
Some(cs) == self.show.craft_sprite.map(|(_, s)| s)
|
||||
})
|
||||
})
|
||||
{
|
||||
RecipeIngredientQuantity::All
|
||||
} else if at_least_some_ingredients {
|
||||
RecipeIngredientQuantity::Some
|
||||
} else {
|
||||
RecipeIngredientQuantity::None
|
||||
};
|
||||
});
|
||||
let state = if show_craft_sprite {
|
||||
RecipeIngredientQuantity::All
|
||||
} else if at_least_some_ingredients {
|
||||
RecipeIngredientQuantity::Some
|
||||
} else {
|
||||
RecipeIngredientQuantity::None
|
||||
};
|
||||
(name, recipe, state)
|
||||
})
|
||||
.collect();
|
||||
|
Loading…
Reference in New Issue
Block a user