mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-09 03:40:23 +00:00
Fixed bounds on Bytes's associated types.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! Interface for converting various structures to and from bytes
|
||||
|
||||
// Imports
|
||||
use std::{error::Error, fmt::Debug};
|
||||
use std::error::Error;
|
||||
|
||||
/// Conversions to and from bytes for the game file
|
||||
pub trait Bytes
|
||||
@@ -9,15 +9,13 @@ where
|
||||
Self: Sized,
|
||||
{
|
||||
/// The type of array required by this structure
|
||||
///
|
||||
/// *MUST* be a `[u8; N]` or `u8`
|
||||
type ByteArray: ByteArray + Sized;
|
||||
type ByteArray: ByteArray;
|
||||
|
||||
/// The error type used for the operation
|
||||
type FromError: Debug + Error;
|
||||
type FromError: Error;
|
||||
|
||||
/// The error type used for the operation
|
||||
type ToError: Debug + Error;
|
||||
type ToError: Error;
|
||||
|
||||
/// Constructs this structure from `bytes`
|
||||
fn from_bytes(bytes: &Self::ByteArray) -> Result<Self, Self::FromError>;
|
||||
|
||||
Reference in New Issue
Block a user