Browse Source

andy vs. clippy round 6

pull/104/head
andy 3 years ago
parent
commit
bb2b62fdc9
  1. 12
      src/entity/character.rs
  2. 19
      src/ship/character.rs

12
src/entity/character.rs

@ -264,11 +264,19 @@ pub struct CharacterMaterials {
pub tp: u32,
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct CharacterKeyboardConfig {
pub keyboard_config: [u8; 0x16C],
}
impl Default for CharacterKeyboardConfig {
fn default() -> CharacterKeyboardConfig {
CharacterKeyboardConfig {
keyboard_config: DEFAULT_KEYBOARD_CONFIG1,
}
}
}
impl CharacterKeyboardConfig {
fn new(preset: usize) -> CharacterKeyboardConfig {
match preset {
@ -309,7 +317,7 @@ impl CharacterKeyboardConfig {
}
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct CharacterGamepadConfig {
pub gamepad_config: [u8; 0x38],
}

19
src/ship/character.rs

@ -82,7 +82,6 @@ impl<'a> CharacterBytesBuilder<'a> {
}
}
#[derive(Default)]
pub struct FullCharacterBytesBuilder<'a> {
character: Option<&'a CharacterEntity>,
@ -98,24 +97,6 @@ pub struct FullCharacterBytesBuilder<'a> {
option_flags: Option<u32>,
}
impl<'a> Default for FullCharacterBytesBuilder<'a> {
fn default() -> FullCharacterBytesBuilder<'a> {
FullCharacterBytesBuilder {
character: None,
stats: None,
level: None,
inventory: None,
bank: None,
keyboard_config: None,
gamepad_config: None,
symbol_chat: None,
tech_menu: None,
option_flags: None,
}
}
}
impl<'a> FullCharacterBytesBuilder<'a> {
#[must_use]
pub fn character(self, character: &'a CharacterEntity) -> FullCharacterBytesBuilder<'a> {

Loading…
Cancel
Save