Browse Source

Merge pull request 'hella warnings cleanup pt 1. remove unused imports, allow deadcode and unused results' (#30) from cleanup_warnings into master

Reviewed-by: jake <jake@sharnoth.com>
pull/3/head
jake 5 years ago
parent
commit
cdd81265c6
  1. 5
      src/item/armor.rs
  2. 5
      src/item/mod.rs
  3. 5
      src/item/shield.rs
  4. 4
      src/item/weapon.rs
  5. 2
      src/packet/login.rs
  6. 7
      src/packet/messages.rs

5
src/item/armor.rs

@ -1,8 +1,3 @@
use std::convert::{TryFrom, Into};
use std::io::{Read, Seek};
use crate::{PSOPacketData, PacketParseError};
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum ArmorType {
Frame,

5
src/item/mod.rs

@ -1,10 +1,11 @@
#![allow(dead_code)]
pub mod weapon;
pub mod tool;
pub mod armor;
pub mod shield;
use std::io::{Read, Seek};
use crate::{PSOPacketData, PacketParseError};
use crate::{PacketParseError};
@ -20,7 +21,7 @@ pub enum Item {
impl Item {
fn from_bytes<R: Read + Seek>(cursor: &mut R) -> Result<Self, PacketParseError> {
fn from_bytes<R: Read + Seek>(_cursor: &mut R) -> Result<Self, PacketParseError> {
unimplemented!()
}
pub fn as_bytes(&self) -> [u8; 16] {

5
src/item/shield.rs

@ -1,8 +1,3 @@
use std::convert::{TryFrom, Into};
use std::io::{Read, Seek};
use crate::{PSOPacketData, PacketParseError};
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum ShieldType {
Barrier,

4
src/item/weapon.rs

@ -1,9 +1,5 @@
use std::convert::{TryFrom, Into};
use std::io::{Read, Seek};
use crate::{PSOPacketData, PacketParseError};
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum Attribute {
Native,

2
src/packet/login.rs

@ -546,7 +546,7 @@ mod tests {
#[test]
fn test_key_settings_reply() {
use super::PSOPacket;
use rand::{Rng, RngCore};
use rand::{Rng};
let mut rng = rand::thread_rng();

7
src/packet/messages.rs

@ -1,4 +1,5 @@
use std::io::{Seek, SeekFrom};
#![allow(unused_must_use)]
use std::io::{SeekFrom};
use psopacket::pso_message;
use crate::{PSOPacketData, PacketParseError};
@ -757,7 +758,7 @@ pub struct DropCoordinates {
drop_area: u32,
x: f32,
z: f32,
drop_ID: u32,
drop_id: u32,
}
#[pso_message(0xC4)]
@ -1062,7 +1063,7 @@ impl PSOPacketData for GameMessage {
cur.seek(SeekFrom::Current(-2)); // Cursor doesn't implement Peek?
match byte[0] {
PlayerActivatedSwitch::CMD => Ok(GameMessage::PlayerActivatedSwitch(PlayerActivatedSwitch::from_bytes(&mut cur)?)),
GuildcardSend::CMD => Ok(GameMessage::GuildcardSend(GuildcardSend::from_bytes(&mut cur)?)),
GuildcardSend::CMD if len[0] == 1 => Ok(GameMessage::GuildcardSend(GuildcardSend::from_bytes(&mut cur)?)),
GuildcardRecv::CMD => Ok(GameMessage::GuildcardRecv(GuildcardRecv::from_bytes(&mut cur)?)),
SymbolChat::CMD => Ok(GameMessage::SymbolChat(SymbolChat::from_bytes(&mut cur)?)),
MobAttack::CMD => Ok(GameMessage::MobAttack(MobAttack::from_bytes(&mut cur)?)),

Loading…
Cancel
Save