Fixed formatting errors from thiserror migration.

This commit is contained in:
2020-07-11 22:03:35 +01:00
parent d876673326
commit 33ffb13555
5 changed files with 20 additions and 20 deletions

View File

@@ -155,7 +155,7 @@ pub enum FromBytesError {
UseAttackAttackType(#[source] property::attack_type::FromBytesError),
/// Unknown effect type
#[error("Unknown byte for an effect type: {}", "byte")]
#[error("Unknown byte for an effect type: {}", byte)]
EffectType { byte: u8 },
}

View File

@@ -73,12 +73,12 @@ pub enum DeserializeError {
/// There were too many cards
#[error(
"Too many cards in table ({} digimon, {} item, {} digivolve, {} / {} bytes max)",
"digimon_cards",
"item_cards",
"digivolve_cards",
" digimon_cards * (0x3 + CardType::Digimon .byte_size() + 0x1) +
digimon_cards,
item_cards,
digivolve_cards,
digimon_cards * (0x3 + CardType::Digimon .byte_size() + 0x1) +
item_cards * (0x3 + CardType::Item .byte_size() + 0x1) +
digivolve_cards * (0x3 + CardType::Digivolve.byte_size() + 0x1)",
digivolve_cards * (0x3 + CardType::Digivolve.byte_size() + 0x1),
Table::MAX_BYTE_SIZE
)]
TooManyCards {
@@ -160,12 +160,12 @@ pub enum SerializeError {
/// There were too many cards
#[error(
"Too many cards in table ({} digimon, {} item, {} digivolve, {} / {} bytes max)",
"digimon_cards",
"item_cards",
"digivolve_cards",
" digimon_cards * (0x3 + CardType::Digimon .byte_size() + 0x1) +
digimon_cards,
item_cards,
digivolve_cards,
digimon_cards * (0x3 + CardType::Digimon .byte_size() + 0x1) +
item_cards * (0x3 + CardType::Item .byte_size() + 0x1) +
digivolve_cards * (0x3 + CardType::Digivolve.byte_size() + 0x1)",
digivolve_cards * (0x3 + CardType::Digivolve.byte_size() + 0x1),
Table::MAX_BYTE_SIZE
)]
TooManyCards {

View File

@@ -39,7 +39,7 @@ pub enum DeserializeError {
ReadHeader(#[source] std::io::Error),
/// Could not read a deck entry
#[error("Unable to read deck entry with id {}", "id")]
#[error("Unable to read deck entry with id {}", id)]
ReadDeck {
id: usize,
#[source]
@@ -47,7 +47,7 @@ pub enum DeserializeError {
},
/// Could not deserialize a deck entry
#[error("Unable to serialize deck entry with id {}", "id")]
#[error("Unable to serialize deck entry with id {}", id)]
DeserializeDeck {
id: usize,
#[source]
@@ -67,7 +67,7 @@ pub enum SerializeError {
WriteHeader(#[source] std::io::Error),
/// Could not deserialize a deck entry
#[error("Unable to deserialize deck entry with id {}", "id")]
#[error("Unable to deserialize deck entry with id {}", id)]
SerializeDeck {
id: usize,
#[source]
@@ -75,7 +75,7 @@ pub enum SerializeError {
},
/// Could not write a deck entry
#[error("Unable to read deck entry with id {}", "id")]
#[error("Unable to read deck entry with id {}", id)]
WriteDeck {
id: usize,
#[source]

View File

@@ -29,7 +29,7 @@ pub macro array_split {
$name:
$( &'a [T; $arr_size], )?
$( &'a T, #[cfg(os = "Os that does not exist")] __field: [u8; $val_size], )?
$( &'a T, #[cfg(invalid)] __field: [u8; $val_size], )?
)*
}
@@ -80,7 +80,7 @@ pub macro array_split_mut {
$name:
$( &'a mut [T; $arr_size], )?
$( &'a mut T, #[cfg(os = "Os that does not exist")] __field: [u8; $val_size], )?
$( &'a mut T, #[cfg(invalid)] __field: [u8; $val_size], )?
)*
}
@@ -158,7 +158,7 @@ pub fn read_maybe_null_ascii_string(buf: &impl AsRef<[u8]>) -> Result<&ascii::As
#[derive(PartialEq, Eq, Clone, Copy, Debug, thiserror::Error)]
pub enum WriteNullAsciiStringError {
/// The input string was too large
#[error("Input string was too large for buffer. ({}+1 / {})", "input_len", "buffer_len")]
#[error("Input string was too large for buffer. ({}+1 / {})", input_len, buffer_len)]
TooLarge { input_len: usize, buffer_len: usize },
}
@@ -185,7 +185,7 @@ pub fn write_null_ascii_string<'a>(input: &ascii::AsciiStr, buf: &'a mut [u8]) -
#[derive(PartialEq, Eq, Clone, Copy, Debug, thiserror::Error)]
pub enum WriteMaybeNullAsciiStringError {
/// The input string was too large
#[error("Input string was too large for buffer. ({} / {})", "input_len", "buffer_len")]
#[error("Input string was too large for buffer. ({} / {})", input_len, buffer_len)]
TooLarge { input_len: usize, buffer_len: usize },
}

View File

@@ -17,7 +17,7 @@ pub use real::Real;
#[derive(PartialEq, Eq, Clone, Copy, Debug, thiserror::Error)]
pub enum RealToDataError {
/// Occurs when the Real is outside of the data section of the sector
#[error("The real address {} could not be converted to a data address as it is not in the data section", _0)]
#[error("The real address {} could not be converted to a data address as it is not in the data section", .0)]
OutsideDataSection(Real),
}