Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Oct 13, 2023
1 parent f69c6c9 commit 8b3057b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/blocks/literals_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ pub enum LiteralsSectionParseError {
#[display(fmt = "{_0:?}")]
#[from]
GetBitsError(GetBitsError),
#[display(fmt = "Not enough byte to parse the literals section header. Have: {have}, Need: {need}")]
#[display(
fmt = "Not enough byte to parse the literals section header. Have: {have}, Need: {need}"
)]
NotEnoughBytes { have: usize, need: u8 },
}

Expand Down
4 changes: 3 additions & 1 deletion src/blocks/sequence_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ impl Default for SequencesHeader {
#[derive(Debug, derive_more::Display)]
#[non_exhaustive]
pub enum SequencesHeaderParseError {
#[display(fmt = "source must have at least {need_at_least} bytes to parse header; got {got} bytes")]
#[display(
fmt = "source must have at least {need_at_least} bytes to parse header; got {got} bytes"
)]
NotEnoughBytes { need_at_least: u8, got: usize },
}

Expand Down
4 changes: 3 additions & 1 deletion src/decoding/bit_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ pub struct BitReader<'s> {
#[derive(Debug, derive_more::Display)]
#[non_exhaustive]
pub enum GetBitsError {
#[display(fmt = "Cant serve this request. The reader is limited to {limit} bits, requested {num_requested_bits} bits")]
#[display(
fmt = "Cant serve this request. The reader is limited to {limit} bits, requested {num_requested_bits} bits"
)]
TooManyBits {
num_requested_bits: usize,
limit: u8,
Expand Down
10 changes: 6 additions & 4 deletions src/decoding/sequence_section_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ use alloc::vec::Vec;
#[non_exhaustive]
pub enum DecodeSequenceError {
#[display(fmt = transparent)]
#[from]
#[from]
GetBitsError(GetBitsError),
#[display(fmt = transparent)]
#[from]
#[from]
FSEDecoderError(FSEDecoderError),
#[display(fmt = transparent)]
#[from]
#[from]
FSETableError(FSETableError),
#[display(fmt = "Padding at the end of the sequence_section was more than a byte long: {skipped_bits} bits. Probably caused by data corruption")]
#[display(
fmt = "Padding at the end of the sequence_section was more than a byte long: {skipped_bits} bits. Probably caused by data corruption"
)]
ExtraPadding { skipped_bits: i32 },
#[display(fmt = "Do not support offsets bigger than 1<<32; got: {offset_code}")]
UnsupportedOffset { offset_code: u8 },
Expand Down
2 changes: 1 addition & 1 deletion src/fse/fse_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct FSEDecoder<'table> {
#[non_exhaustive]
pub enum FSEDecoderError {
#[display(fmt = transparent)]
#[from]
#[from]
GetBitsError(GetBitsError),
#[display(fmt = "Tried to use an uninitialized table!")]
TableIsUninitialized,
Expand Down

0 comments on commit 8b3057b

Please sign in to comment.