From e337163a9228b32475f6b34831c43866c9cd547c Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sat, 14 Sep 2024 12:15:30 +0800 Subject: [PATCH] Apply cargo fmt --- src/common/concurrent.rs | 2 +- src/common/concurrent/deques.rs | 2 +- src/common/timer_wheel.rs | 2 +- src/future/base_cache.rs | 2 +- src/future/invalidator.rs | 2 +- src/future/value_initializer.rs | 2 +- src/sync/value_initializer.rs | 2 +- src/sync_base/base_cache.rs | 2 +- src/sync_base/invalidator.rs | 2 +- src/sync_base/key_lock.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/concurrent.rs b/src/common/concurrent.rs index 95686327..366edf50 100644 --- a/src/common/concurrent.rs +++ b/src/common/concurrent.rs @@ -1,9 +1,9 @@ use crate::common::{deque::DeqNode, time::Instant}; +use moka_arc::MiniArc; use parking_lot::Mutex; use std::{fmt, ptr::NonNull, sync::Arc}; use tagptr::TagNonNull; -use moka_arc::MiniArc; pub(crate) mod constants; pub(crate) mod deques; diff --git a/src/common/concurrent/deques.rs b/src/common/concurrent/deques.rs index 37245b1e..8a14c7e4 100644 --- a/src/common/concurrent/deques.rs +++ b/src/common/concurrent/deques.rs @@ -4,9 +4,9 @@ use crate::common::{ CacheRegion, }; +use moka_arc::MiniArc; use std::ptr::NonNull; use tagptr::TagNonNull; -use moka_arc::MiniArc; pub(crate) struct Deques { pub(crate) window: Deque>, // Not used yet. diff --git a/src/common/timer_wheel.rs b/src/common/timer_wheel.rs index 73add563..9598bbbf 100644 --- a/src/common/timer_wheel.rs +++ b/src/common/timer_wheel.rs @@ -19,8 +19,8 @@ use super::{ time::{CheckedTimeOps, Instant}, }; -use parking_lot::Mutex; use moka_arc::MiniArc; +use parking_lot::Mutex; const BUCKET_COUNTS: &[u64] = &[ 64, // roughly seconds diff --git a/src/future/base_cache.rs b/src/future/base_cache.rs index f302b66a..d6cc3ccc 100644 --- a/src/future/base_cache.rs +++ b/src/future/base_cache.rs @@ -39,6 +39,7 @@ use async_lock::{Mutex, MutexGuard, RwLock}; use crossbeam_channel::{Receiver, Sender, TrySendError}; use crossbeam_utils::atomic::AtomicCell; use futures_util::future::BoxFuture; +use moka_arc::MiniArc; use parking_lot::RwLock as SyncRwLock; use smallvec::SmallVec; use std::{ @@ -51,7 +52,6 @@ use std::{ }, time::{Duration, Instant as StdInstant}, }; -use moka_arc::MiniArc; pub(crate) type HouseKeeperArc = Arc; diff --git a/src/future/invalidator.rs b/src/future/invalidator.rs index 27e8f1e2..7bc4eb68 100644 --- a/src/future/invalidator.rs +++ b/src/future/invalidator.rs @@ -9,6 +9,7 @@ use crate::{ }; use async_lock::{Mutex, MutexGuard}; +use moka_arc::MiniArc; use std::{ hash::{BuildHasher, Hash}, sync::{ @@ -16,7 +17,6 @@ use std::{ Arc, }, }; -use moka_arc::MiniArc; use uuid::Uuid; pub(crate) type PredicateFun = Arc bool + Send + Sync + 'static>; diff --git a/src/future/value_initializer.rs b/src/future/value_initializer.rs index 53d40929..c56eeacc 100644 --- a/src/future/value_initializer.rs +++ b/src/future/value_initializer.rs @@ -1,5 +1,6 @@ use async_lock::{RwLock, RwLockWriteGuard}; use futures_util::FutureExt; +use moka_arc::MiniArc; use std::{ any::{Any, TypeId}, fmt, @@ -8,7 +9,6 @@ use std::{ pin::Pin, sync::Arc, }; -use moka_arc::MiniArc; use crate::{ ops::compute::{CompResult, Op}, diff --git a/src/sync/value_initializer.rs b/src/sync/value_initializer.rs index 90528f46..66034972 100644 --- a/src/sync/value_initializer.rs +++ b/src/sync/value_initializer.rs @@ -1,3 +1,4 @@ +use moka_arc::MiniArc; use parking_lot::RwLock; use std::{ any::{Any, TypeId}, @@ -5,7 +6,6 @@ use std::{ hash::{BuildHasher, Hash}, sync::Arc, }; -use moka_arc::MiniArc; use crate::{ ops::compute::{CompResult, Op}, diff --git a/src/sync_base/base_cache.rs b/src/sync_base/base_cache.rs index d262cd59..1d3a6281 100644 --- a/src/sync_base/base_cache.rs +++ b/src/sync_base/base_cache.rs @@ -32,6 +32,7 @@ use crate::{ use crossbeam_channel::{Receiver, Sender, TrySendError}; use crossbeam_utils::atomic::AtomicCell; +use moka_arc::MiniArc; use parking_lot::{Mutex, RwLock}; use smallvec::SmallVec; use std::{ @@ -45,7 +46,6 @@ use std::{ }, time::{Duration, Instant as StdInstant}, }; -use moka_arc::MiniArc; pub(crate) type HouseKeeperArc = Arc; diff --git a/src/sync_base/invalidator.rs b/src/sync_base/invalidator.rs index f281f709..f51435a6 100644 --- a/src/sync_base/invalidator.rs +++ b/src/sync_base/invalidator.rs @@ -8,6 +8,7 @@ use crate::{ PredicateError, }; +use moka_arc::MiniArc; use parking_lot::{Mutex, MutexGuard}; use std::{ hash::{BuildHasher, Hash}, @@ -16,7 +17,6 @@ use std::{ Arc, }, }; -use moka_arc::MiniArc; use uuid::Uuid; pub(crate) type PredicateFun = Arc bool + Send + Sync + 'static>; diff --git a/src/sync_base/key_lock.rs b/src/sync_base/key_lock.rs index fc5ad402..c58c6eed 100644 --- a/src/sync_base/key_lock.rs +++ b/src/sync_base/key_lock.rs @@ -5,8 +5,8 @@ use std::{ use crate::cht::SegmentedHashMap; -use parking_lot::{Mutex, MutexGuard}; use moka_arc::MiniArc; +use parking_lot::{Mutex, MutexGuard}; const LOCK_MAP_NUM_SEGMENTS: usize = 64;