Updated rustfmt.toml.

This commit is contained in:
Filipe Rodrigues 2021-03-28 21:00:18 +01:00
parent c705db9658
commit 5b484eece3
6 changed files with 13 additions and 7 deletions

View File

@ -19,7 +19,10 @@ macro_rules! derive_bytes_split {
type ToError = !;
fn from_bytes(bytes: &Self::ByteArray) -> Result<Self, Self::FromError> {
let ( $($field,)* ) = arrayref::array_refs![bytes, $( <<$U as ByteOrderExt<$crate::byteorder::$BYTEORDER>>::ByteArray as ByteArray>::SIZE ),*];
let ( $($field,)* ) = arrayref::array_refs![
bytes,
$( <<$U as ByteOrderExt<$crate::byteorder::$BYTEORDER>>::ByteArray as ByteArray>::SIZE ),*
];
Ok(Self {
$(
@ -29,7 +32,10 @@ macro_rules! derive_bytes_split {
}
fn to_bytes(&self, bytes: &mut Self::ByteArray) -> Result<(), Self::ToError> {
let ( $($field,)* ) = arrayref::mut_array_refs![bytes, $( <<$U as ByteOrderExt<$crate::byteorder::$BYTEORDER>>::ByteArray as ByteArray>::SIZE ),*];
let ( $($field,)* ) = arrayref::mut_array_refs![
bytes,
$( <<$U as ByteOrderExt<$crate::byteorder::$BYTEORDER>>::ByteArray as ByteArray>::SIZE ),*
];
$(
<$U as ByteOrderExt::<$crate::byteorder::$BYTEORDER>>::write(&self.$field.into(), $field);

View File

@ -31,7 +31,7 @@ pub enum ToBytesError {
/// Out of range minute
#[error("Out of range minute {_0:#x}")]
OutOfRangeMinute(u8),
/// Out of range second
#[error("Out of range second {_0:#x}")]
OutOfRangeSecond(u8),

View File

@ -1,7 +1,7 @@
//! File reader
// Imports
use dcb_cdrom_xa::{CdRomReader, Sector, reader::ReadSectorError};
use dcb_cdrom_xa::{reader::ReadSectorError, CdRomReader, Sector};
use std::{convert::TryFrom, io};
/// A file reader

View File

@ -23,7 +23,7 @@ pub enum FromReaderError {
/// Unable to get position
#[error("Unable to get position")]
GetPos(#[source] io::Error),
/// Unable to read model
#[error("Unable to read model")]
ReadModel(#[source] model::FromReaderError),

View File

@ -17,7 +17,7 @@ pub enum FromReaderError {
/// Unable to read object
#[error("Unable to read object")]
ReadObj(#[source] io::Error),
/// Unable to seek past model
#[error("Unable to seek past model")]
SeekPastModel(#[source] io::Error),

View File

@ -14,7 +14,7 @@ use_field_init_shorthand = true
enum_discrim_align_threshold = 100
fn_args_layout = "Compressed"
merge_derives = false
merge_imports = true
imports_granularity="Crate"
max_width = 150
use_small_heuristics = "Default"
indent_style = "Block"