All code is now formatted.

Started using `err_impl::Error` where possible.
This commit is contained in:
2020-05-01 11:29:01 +01:00
parent c031d151a7
commit 280bdac119
21 changed files with 1135 additions and 1350 deletions

View File

@@ -3,22 +3,22 @@
/// Convertions to and from bytes for the game file
pub trait Bytes
where
Self: Sized
Self: Sized,
{
/// The type of array required by this structure
///
///
/// *MUST* be a `[u8; N]`
type ByteArray: Sized;
/// The error type used for the operation
type FromError: std::fmt::Debug + std::error::Error;
/// The error type used for the operation
type ToError: std::fmt::Debug + std::error::Error;
/// Constructs this structure from `bytes`
fn from_bytes(bytes: &Self::ByteArray) -> Result<Self, Self::FromError>;
/// Writes this structure to `bytes`
fn to_bytes(&self, bytes: &mut Self::ByteArray) -> Result<(), Self::ToError>;
}