mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-09 11:48:16 +00:00
Now using min_const_generics.
This commit is contained in:
@@ -75,6 +75,7 @@ impl Table {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::use_self)] // TODO: Remove once `min_const_generics` allows us to use it
|
||||
impl Table {
|
||||
/// Deserializes the card table from a game file
|
||||
pub fn deserialize<R: Read + Write + Seek>(file: &mut GameFile<R>) -> Result<Self, DeserializeError> {
|
||||
@@ -83,7 +84,7 @@ impl Table {
|
||||
.map_err(DeserializeError::Seek)?;
|
||||
|
||||
// Read header
|
||||
let mut header_bytes = [0u8; Self::HEADER_BYTE_SIZE];
|
||||
let mut header_bytes = [0u8; Table::HEADER_BYTE_SIZE];
|
||||
file.read_exact(&mut header_bytes).map_err(DeserializeError::ReadHeader)?;
|
||||
let header = array_split! {&header_bytes,
|
||||
magic: [0x4],
|
||||
|
||||
@@ -41,6 +41,7 @@ impl Table {
|
||||
const START_ADDRESS: Data = Data::from_u64(0x21a6800);
|
||||
}
|
||||
|
||||
#[allow(clippy::use_self)] // TODO: Remove once `min_const_generics` allows us to use it
|
||||
impl Table {
|
||||
/// Deserializes the deck table from `file`.
|
||||
pub fn deserialize<R>(file: &mut GameFile<R>) -> Result<Self, DeserializeError>
|
||||
@@ -52,7 +53,7 @@ impl Table {
|
||||
.map_err(DeserializeError::Seek)?;
|
||||
|
||||
// Read header
|
||||
let mut header_bytes = [0u8; Self::HEADER_BYTE_SIZE];
|
||||
let mut header_bytes = [0u8; Table::HEADER_BYTE_SIZE];
|
||||
file.read_exact(&mut header_bytes).map_err(DeserializeError::ReadHeader)?;
|
||||
|
||||
// Check if the magic is right
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
external_doc,
|
||||
format_args_capture,
|
||||
const_fn,
|
||||
const_panic
|
||||
const_panic,
|
||||
min_const_generics
|
||||
)]
|
||||
// Lints
|
||||
#![warn(clippy::restriction, clippy::pedantic, clippy::nursery)]
|
||||
|
||||
Reference in New Issue
Block a user