Browse Source

lint src/entity/*

pull/42/head
jake 3 years ago
parent
commit
6f40058b7d
  1. 44
      src/entity/character.rs

44
src/entity/character.rs

@ -44,9 +44,9 @@ impl From<u8> for CharacterClass {
}
}
impl Into<u8> for CharacterClass {
fn into(self) -> u8 {
match self {
impl From<CharacterClass> for u8 {
fn from(other: CharacterClass) -> u8 {
match other {
CharacterClass::HUmar => 0,
CharacterClass::HUnewearl => 1,
CharacterClass::HUcast => 2,
@ -65,29 +65,27 @@ impl Into<u8> for CharacterClass {
impl CharacterClass {
pub fn is_human(&self) -> bool {
match self {
CharacterClass::HUmar |
CharacterClass::RAmar | CharacterClass::RAmarl |
CharacterClass::FOmar | CharacterClass::FOmarl => true,
_ => false,
}
matches!(self,
CharacterClass::HUmar |
CharacterClass::RAmar |
CharacterClass::RAmarl |
CharacterClass::FOmar |
CharacterClass::FOmarl)
}
pub fn is_newman(&self) -> bool {
match self {
CharacterClass::HUnewearl |
CharacterClass::FOnewm | CharacterClass::FOnewearl => true,
_ => false,
}
matches!(self,
CharacterClass::HUnewearl |
CharacterClass::FOnewm |
CharacterClass::FOnewearl)
}
pub fn is_android(&self) -> bool {
match self {
CharacterClass::HUcast | CharacterClass::HUcaseal |
CharacterClass::RAcast | CharacterClass::RAcaseal => true,
_ => false,
}
matches!(self,
CharacterClass::HUcast |
CharacterClass::HUcaseal |
CharacterClass::RAcast |
CharacterClass::RAcaseal)
}
}
@ -124,9 +122,9 @@ impl From<u8> for SectionID {
}
}
impl Into<u8> for SectionID {
fn into(self) -> u8 {
match self {
impl From<SectionID> for u8 {
fn from(other: SectionID) -> u8 {
match other {
SectionID::Viridia => 0,
SectionID::Greenill => 1,
SectionID::Skyly => 2,

Loading…
Cancel
Save