Skip to content

Commit

Permalink
make clippy happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Sep 6, 2024
1 parent 776117a commit bad8cfb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/blocks/literals_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use super::super::decoding::bit_reader::{BitReader, GetBitsError};

/// A compressed block consists of two sections, a literals section, and a sequences section.
///
/// This is the first of those two sections. A literal is just any arbitrary data, and it is copied by the sequences section
pub struct LiteralsSection {
/// - If this block is of type [LiteralsSectionType::Raw], then the data is `regenerated_bytes`
Expand Down
2 changes: 1 addition & 1 deletion src/decoding/bit_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl core::fmt::Display for GetBitsError {
}

impl<'s> BitReader<'s> {
pub fn new(source: &'s [u8]) -> BitReader<'_> {
pub fn new(source: &'s [u8]) -> BitReader<'s> {
BitReader { idx: 0, source }
}

Expand Down
2 changes: 1 addition & 1 deletion src/decoding/bit_reader_reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'s> BitReaderReversed<'s> {
self.idx + self.bits_in_container as isize
}

pub fn new(source: &'s [u8]) -> BitReaderReversed<'_> {
pub fn new(source: &'s [u8]) -> BitReaderReversed<'s> {
BitReaderReversed {
idx: source.len() as isize * 8,
source,
Expand Down
6 changes: 5 additions & 1 deletion src/frame_decoder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Framedecoder is the man struct users interact with to decode zstd frames
//!
//! Zstandard compressed data is made of one or more [Frame]s. Each frame is independent and can be
//! decompressed independently of other frames. This module contains structures
//! and utilities that can be used to decode a frame.
Expand All @@ -13,7 +15,9 @@ use core::convert::TryInto;
#[cfg(feature = "std")]
use std::error::Error as StdError;

/// This implements a decoder for zstd frames. This decoder is able to decode frames only partially and gives control
/// This implements a decoder for zstd frames.
///
/// This decoder is able to decode frames only partially and gives control
/// over how many bytes/blocks will be decoded at a time (so you don't have to decode a 10GB file into memory all at once).
/// It reads bytes as needed from a provided source and can be read from to collect partial results.
///
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 @@ -166,7 +166,7 @@ fn highest_bit_set(x: u32) -> u32 {

impl<'t> FSEDecoder<'t> {
/// Initialize a new Finite State Entropy decoder.
pub fn new(table: &'t FSETable) -> FSEDecoder<'_> {
pub fn new(table: &'t FSETable) -> FSEDecoder<'t> {
FSEDecoder {
state: table.decode.first().copied().unwrap_or(Entry {
base_line: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ fn test_incremental_read() {

let mut output = [0u8; 3];
let (_, written) = frame_dec
.decode_from_to(&unread_compressed_content, &mut output)
.decode_from_to(unread_compressed_content, &mut output)
.unwrap();

assert_eq!(written, 3);
Expand Down

0 comments on commit bad8cfb

Please sign in to comment.