From 60bcfd78ecc765a81712fb083d04f3899f64db55 Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 18 Jun 2021 12:38:33 -0600 Subject: [PATCH] lint src/ship/packet/builder/* --- src/ship/packet/builder/lobby.rs | 4 ++-- src/ship/packet/builder/message.rs | 4 ++-- src/ship/packet/builder/quest.rs | 2 +- src/ship/packet/builder/room.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ship/packet/builder/lobby.rs b/src/ship/packet/builder/lobby.rs index b0a0d8e..56213dd 100644 --- a/src/ship/packet/builder/lobby.rs +++ b/src/ship/packet/builder/lobby.rs @@ -18,7 +18,7 @@ pub fn join_lobby(id: ClientId, let playerinfo = lobby_clients.iter() .map(|area_client| { let client = clients.get(&area_client.client).ok_or(ShipError::ClientNotFound(area_client.client)).unwrap(); - player_info(0x100, &client, area_client, item_manager, level_table) + player_info(0x100, client, area_client, item_manager, level_table) }); let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); @@ -55,7 +55,7 @@ pub fn add_to_lobby(id: ClientId, block: client.block as u16, event: 0, padding: 0, - playerinfo: player_info(0x100, &client, &area_client, item_manager, level_table), + playerinfo: player_info(0x100, client, &area_client, item_manager, level_table), }) } diff --git a/src/ship/packet/builder/message.rs b/src/ship/packet/builder/message.rs index 91d4149..dfe1ac5 100644 --- a/src/ship/packet/builder/message.rs +++ b/src/ship/packet/builder/message.rs @@ -142,8 +142,8 @@ pub fn player_no_longer_has_item(area_client: AreaClient, item_id: ClientItemId, } } -pub fn shop_list(shop_type: u8, items: &Vec) -> ShopList { - let items = items.into_iter() +pub fn shop_list(shop_type: u8, items: &[I]) -> ShopList { + let items = items.iter() .enumerate() .map(|(i, item)| { ShopListItem { diff --git a/src/ship/packet/builder/quest.rs b/src/ship/packet/builder/quest.rs index 089fe56..8078517 100644 --- a/src/ship/packet/builder/quest.rs +++ b/src/ship/packet/builder/quest.rs @@ -22,7 +22,7 @@ pub fn quest_category_list(quests: &QuestList) -> QuestCategoryList { } } -pub fn quest_list(category_id: u32, quests: &Vec) -> QuestOptionList { +pub fn quest_list(category_id: u32, quests: &[Quest]) -> QuestOptionList { let quest_entries = quests.iter() .map(|quest| { QuestEntry { diff --git a/src/ship/packet/builder/room.rs b/src/ship/packet/builder/room.rs index 7dda664..2eb8fc7 100644 --- a/src/ship/packet/builder/room.rs +++ b/src/ship/packet/builder/room.rs @@ -20,7 +20,7 @@ pub fn join_room(id: ClientId, let header_client = clients.get(&c.client).ok_or(ShipError::ClientNotFound(id))?; let header_area_client = client_location.get_local_client(id).map_err(|err| -> ClientLocationError { err.into() })?; acc.map(|mut a| { - a[i] = player_header(0x10000, &header_client, &header_area_client); + a[i] = player_header(0x10000, header_client, &header_area_client); a }) })?; @@ -67,7 +67,7 @@ pub fn add_to_room(_id: ClientId, block: 0, event: 0, padding: 0, - playerinfo: player_info(0x10000, client, &area_client, item_manager, level_table), + playerinfo: player_info(0x10000, client, area_client, item_manager, level_table), }) }