From 4f8a75f9d7630df863ac95ea1901f0c4fdf60821 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 22 Oct 2022 14:12:38 -0600 Subject: [PATCH] cleanup --- src/ship/items/actions.rs | 6 ++---- src/ship/items/apply_item.rs | 7 +++---- src/ship/items/tasks.rs | 3 +-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/ship/items/actions.rs b/src/ship/items/actions.rs index acacbfd..c6875ef 100644 --- a/src/ship/items/actions.rs +++ b/src/ship/items/actions.rs @@ -785,7 +785,6 @@ where let func1 = Arc::new(func1); let func2 = Arc::new(func2); move |(item_state, transaction), input| { - let input = input.clone(); let func1 = func1.clone(); let func2 = func2.clone(); Box::pin(async move { @@ -1106,9 +1105,8 @@ where let mut character = character.clone(); Box::pin(async move { for action in apply_item_actions { - match action { - ApplyItemAction::UpdateCharacter(new_character) => character = *new_character, - _ => {} + if let ApplyItemAction::UpdateCharacter(new_character) = action { + character = *new_character } } diff --git a/src/ship/items/apply_item.rs b/src/ship/items/apply_item.rs index edba120..b78a94b 100644 --- a/src/ship/items/apply_item.rs +++ b/src/ship/items/apply_item.rs @@ -1,12 +1,11 @@ use std::convert::TryInto; -use futures::future::{join_all, BoxFuture, LocalBoxFuture}; -use futures::stream::{FuturesOrdered, StreamExt}; +use futures::future::join_all; use thiserror::Error; -use rand::{Rng, SeedableRng}; +use rand::SeedableRng; use rand::distributions::{WeightedIndex, Distribution}; use crate::entity::gateway::{EntityGateway, GatewayError}; use crate::entity::character::CharacterEntity; -use crate::entity::item::mag::{MagType, MagCell, MagCellError}; +use crate::entity::item::mag::{MagCell, MagCellError}; use crate::entity::item::tool::{Tool, ToolType}; use crate::entity::item::{ItemDetail, ItemEntityId}; use crate::ship::items::state::{ItemStateProxy, ItemStateError}; diff --git a/src/ship/items/tasks.rs b/src/ship/items/tasks.rs index 01671d2..a1ab65c 100644 --- a/src/ship/items/tasks.rs +++ b/src/ship/items/tasks.rs @@ -9,7 +9,6 @@ use crate::ship::items::state::{ItemState, ItemStateProxy, ItemStateError, Indiv use crate::ship::items::itemstateaction::{ItemStateAction, ItemAction}; use crate::ship::items::inventory::InventoryItem; use crate::ship::items::floor::FloorItem; -use crate::ship::items::apply_item::ApplyItemAction; use crate::entity::item::ItemModifier; use crate::ship::shops::ShopItem; use crate::ship::trade::TradeItem; @@ -283,7 +282,7 @@ where let item_state_proxy = ItemStateProxy::new(item_state.clone()); let ((item_state_proxy, transaction), (pkts, new_character)) = ItemStateAction::default() .act(actions::take_item_from_inventory(character.id, *item_id, amount)) - .act(actions::use_consumed_item(&character)) + .act(actions::use_consumed_item(character)) .act(actions::fork( actions::foreach(actions::apply_item_action_packets(character.id, area_client)), actions::apply_item_action_character(character)