Now using min_const_generics.

This commit is contained in:
2020-09-09 12:35:28 +01:00
parent faa6beacfa
commit 46470cdae7
3 changed files with 6 additions and 3 deletions

View File

@@ -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],

View File

@@ -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

View File

@@ -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)]