From ea1f59899da36e57a4e05a7586dfb85e9bc4aa58 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 4 Nov 2019 22:07:04 -0800 Subject: [PATCH] use ShipList::new --- src/login/character.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/login/character.rs b/src/login/character.rs index 24b3fa8..5f36870 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -212,16 +212,15 @@ impl CharacterServerState { fn send_ship_list(&mut self, _id: ClientId, _pkt: &Login) -> Result, CharacterError> { Ok(vec![SendCharacterPacket::Timestamp(Timestamp::new(chrono::Utc::now())), - SendCharacterPacket::ShipList(ShipList { - ships: self.ships.iter().enumerate().map(|(i, s)| { - ShipListEntry { - menu: SHIP_MENU_ID, - item: i as u32, - flags: 0, - name: utf8_to_utf16_array!(s.name, 0x11) + SendCharacterPacket::ShipList(ShipList::new(self.ships.iter().enumerate().map(|(i, s)| { + ShipListEntry { + menu: SHIP_MENU_ID, + item: i as u32, + flags: 0, + name: utf8_to_utf16_array!(s.name, 0x11) } - }).collect() - })]) + }).collect())) + ]) } fn get_settings(&mut self, id: ClientId) -> Result, CharacterError> {