From af4e4e43b9afac98c493c20be09fadb0309a236b Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sun, 2 Jul 2023 10:18:46 -0700 Subject: [PATCH] cargo fmt --- src/hash.rs | 5 +++-- src/lz77.rs | 3 +-- src/squeeze.rs | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/hash.rs b/src/hash.rs index 2135994..b62973f 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -1,4 +1,5 @@ use alloc::vec::Vec; + use lockfree_object_pool::LinearObjectPool; use once_cell::sync::Lazy; @@ -160,5 +161,5 @@ impl ZopfliHash { } } -pub static HASH_POOL: Lazy> = Lazy::new(|| LinearObjectPool::new( - ZopfliHash::new, |hash| hash.reset())); +pub static HASH_POOL: Lazy> = + Lazy::new(|| LinearObjectPool::new(ZopfliHash::new, ZopfliHash::reset)); diff --git a/src/lz77.rs b/src/lz77.rs index c170fd4..ddd4436 100644 --- a/src/lz77.rs +++ b/src/lz77.rs @@ -3,7 +3,7 @@ use core::cmp; use crate::{ cache::{Cache, NoCache, ZopfliLongestMatchCache}, - hash::{Which, ZopfliHash}, + hash::{Which, ZopfliHash, HASH_POOL}, symbols::{get_dist_symbol, get_length_symbol}, util::{ ZOPFLI_MAX_CHAIN_HITS, ZOPFLI_MAX_MATCH, ZOPFLI_MIN_MATCH, ZOPFLI_NUM_D, ZOPFLI_NUM_LL, @@ -11,7 +11,6 @@ use crate::{ }, Options, }; -use crate::hash::HASH_POOL; #[derive(Clone, Copy)] pub enum LitLen { diff --git a/src/squeeze.rs b/src/squeeze.rs index e4b1e81..4376ff2 100644 --- a/src/squeeze.rs +++ b/src/squeeze.rs @@ -15,12 +15,11 @@ use log::{debug, trace}; use crate::{ cache::Cache, deflate::{calculate_block_size, BlockType}, - hash::ZopfliHash, + hash::{ZopfliHash, HASH_POOL}, lz77::{find_longest_match, LitLen, Lz77Store, ZopfliBlockState}, symbols::{get_dist_extra_bits, get_dist_symbol, get_length_extra_bits, get_length_symbol}, util::{ZOPFLI_MAX_MATCH, ZOPFLI_NUM_D, ZOPFLI_NUM_LL, ZOPFLI_WINDOW_MASK, ZOPFLI_WINDOW_SIZE}, }; -use crate::hash::HASH_POOL; const K_INV_LOG2: f64 = core::f64::consts::LOG2_E; // 1.0 / log(2.0)